home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-07-11 | 17.9 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Jul 11 14:35:04 1995, modified Tue Jul 11 14:35:04 1995, creator 'MPS ', type ASCII, 17431 bytes "ProjectAlias.c" , at 0x4497 564 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 50 72 6f 6a 65 63 | 74 41 6c 69 61 73 2e 63 |..Projec|tAlias.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 44 17 00 | 00 02 34 ac 28 74 d8 ac |.....D..|..4.(t..|
|00000060| 28 74 d8 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |(t......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fe c6 00 00 |........|........|
|00000080| 2f 2a 20 50 72 6f 6a 65 | 63 74 41 6c 69 61 73 2e |/* Proje|ctAlias.|
|00000090| 63 3a 20 50 72 6f 6a 65 | 63 74 6f 72 44 42 20 61 |c: Proje|ctorDB a|
|000000a0| 6c 69 61 73 20 6d 61 6e | 61 67 65 6d 65 6e 74 20 |lias man|agement |
|000000b0| 72 6f 75 74 69 6e 65 73 | 20 66 6f 72 20 50 72 6f |routines| for Pro|
|000000c0| 6a 65 63 74 44 72 61 67 | 0d 20 2a 0d 20 2a 20 41 |jectDrag|. *. * A|
|000000d0| 20 73 65 74 20 6f 66 20 | 61 70 70 6c 65 74 73 20 | set of |applets |
|000000e0| 66 6f 72 20 64 72 61 67 | 20 61 6e 64 20 64 72 6f |for drag| and dro|
|000000f0| 70 20 73 6f 75 72 63 65 | 20 63 6f 6e 74 72 6f 6c |p source| control|
|00000100| 20 62 79 20 54 69 6d 20 | 4d 61 72 6f 6e 65 79 2e | by Tim |Maroney.|
|00000110| 0d 20 2a 20 53 65 65 20 | 64 65 76 65 6c 6f 70 2c |. * See |develop,|
|00000120| 20 69 73 73 75 65 20 32 | 33 20 66 6f 72 20 64 65 | issue 2|3 for de|
|00000130| 74 61 69 6c 73 2e 0d 20 | 2a 0d 20 2a 20 42 75 69 |tails.. |*. * Bui|
|00000140| 6c 74 20 6f 6e 20 44 72 | 6f 70 53 68 65 6c 6c 20 |lt on Dr|opShell |
|00000150| 62 79 20 4c 65 6f 6e 61 | 72 64 20 52 6f 73 65 6e |by Leona|rd Rosen|
|00000160| 74 68 6f 6c 2c 20 53 74 | 65 70 68 61 6e 20 53 6f |thol, St|ephan So|
|00000170| 6d 6f 67 79 69 2c 20 61 | 6e 64 20 4d 61 72 73 68 |mogyi, a|nd Marsh|
|00000180| 61 6c 6c 20 43 6c 6f 77 | 2c 0d 20 2a 20 61 6e 64 |all Clow|,. * and|
|00000190| 20 75 73 69 6e 67 20 74 | 68 65 20 4d 6f 72 65 46 | using t|he MoreF|
|000001a0| 69 6c 65 73 20 75 74 69 | 6c 69 74 69 65 73 20 62 |iles uti|lities b|
|000001b0| 79 20 4a 69 6d 20 4c 75 | 74 68 65 72 2e 0d 20 2a |y Jim Lu|ther.. *|
|000001c0| 0d 20 2a 20 54 68 69 73 | 20 73 6f 66 74 77 61 72 |. * This| softwar|
|000001d0| 65 20 69 73 20 66 72 65 | 65 2c 20 62 75 74 20 64 |e is fre|e, but d|
|000001e0| 6f 6e 27 74 20 6d 6f 64 | 69 66 79 20 61 6e 64 20 |on't mod|ify and |
|000001f0| 72 65 64 69 73 74 72 69 | 62 75 74 65 20 69 74 20 |redistri|bute it |
|00000200| 77 69 74 68 6f 75 74 0d | 20 2a 20 63 68 61 6e 67 |without.| * chang|
|00000210| 69 6e 67 20 74 68 65 20 | 73 74 61 74 75 73 20 77 |ing the |status w|
|00000220| 69 6e 64 6f 77 20 74 6f | 20 69 6e 64 69 63 61 74 |indow to| indicat|
|00000230| 65 20 79 6f 75 72 20 6e | 61 6d 65 20 61 6e 64 20 |e your n|ame and |
|00000240| 79 6f 75 72 20 63 68 61 | 6e 67 65 73 21 0d 20 2a |your cha|nges!. *|
|00000250| 2f 0d 0d 23 69 6e 63 6c | 75 64 65 20 3c 45 72 72 |/..#incl|ude <Err|
|00000260| 6f 72 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ors.h>.#|include |
|00000270| 3c 46 69 6e 64 65 72 2e | 68 3e 0d 23 69 6e 63 6c |<Finder.|h>.#incl|
|00000280| 75 64 65 20 3c 52 65 73 | 6f 75 72 63 65 73 2e 68 |ude <Res|ources.h|
|00000290| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 53 63 72 69 |>.#inclu|de <Scri|
|000002a0| 70 74 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |pt.h>.#i|nclude <|
|000002b0| 54 65 78 74 55 74 69 6c | 73 2e 68 3e 0d 23 69 6e |TextUtil|s.h>.#in|
|000002c0| 63 6c 75 64 65 20 3c 4c | 6f 77 4d 65 6d 2e 68 3e |clude <L|owMem.h>|
|000002d0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 53 74 61 6e 64 |.#includ|e <Stand|
|000002e0| 61 72 64 46 69 6c 65 2e | 68 3e 0d 0d 23 69 6e 63 |ardFile.|h>..#inc|
|000002f0| 6c 75 64 65 20 22 50 72 | 6f 6a 65 63 74 41 6c 69 |lude "Pr|ojectAli|
|00000300| 61 73 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |as.h".#i|nclude "|
|00000310| 53 6f 75 72 63 65 53 65 | 72 76 65 72 2e 68 22 0d |SourceSe|rver.h".|
|00000320| 23 69 6e 63 6c 75 64 65 | 20 22 4d 6f 72 65 46 69 |#include| "MoreFi|
|00000330| 6c 65 73 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |les.h".#|include |
|00000340| 22 4d 6f 72 65 46 69 6c | 65 73 45 78 74 72 61 73 |"MoreFil|esExtras|
|00000350| 2e 68 22 0d 0d 0d 74 79 | 70 65 64 65 66 20 73 74 |.h"...ty|pedef st|
|00000360| 72 75 63 74 20 4e 61 6d | 65 4d 61 70 70 69 6e 67 |ruct Nam|eMapping|
|00000370| 0d 7b 0d 09 73 74 72 75 | 63 74 20 4e 61 6d 65 4d |.{..stru|ct NameM|
|00000380| 61 70 70 69 6e 67 20 2a | 66 4e 65 78 74 3b 0d 09 |apping *|fNext;..|
|00000390| 53 74 72 69 6e 67 50 74 | 72 20 66 50 72 6f 6a 65 |StringPt|r fProje|
|000003a0| 63 74 4e 61 6d 65 3b 0d | 09 53 74 72 69 6e 67 50 |ctName;.|.StringP|
|000003b0| 74 72 20 66 46 6f 6c 64 | 65 72 4e 61 6d 65 3b 0d |tr fFold|erName;.|
|000003c0| 7d 20 4e 61 6d 65 4d 61 | 70 70 69 6e 67 3b 0d 0d |} NameMa|pping;..|
|000003d0| 0d 4f 53 45 72 72 20 46 | 69 6e 64 50 72 6f 6a 65 |.OSErr F|indProje|
|000003e0| 63 74 41 6c 69 61 73 46 | 72 6f 6d 50 72 6f 6a 65 |ctAliasF|romProje|
|000003f0| 63 74 4e 61 6d 65 28 53 | 74 72 69 6e 67 50 74 72 |ctName(S|tringPtr|
|00000400| 20 74 6f 70 50 72 6f 6a | 65 63 74 4e 61 6d 65 2c | topProj|ectName,|
|00000410| 20 53 74 72 69 6e 67 50 | 74 72 20 72 65 61 6c 50 | StringP|tr realP|
|00000420| 72 6f 6a 65 63 74 4e 61 | 6d 65 2c 0d 09 09 09 09 |rojectNa|me,.....|
|00000430| 09 09 09 09 09 09 41 6c | 69 61 73 48 61 6e 64 6c |......Al|iasHandl|
|00000440| 65 20 2a 61 6c 69 61 73 | 4f 75 74 2c 20 42 6f 6f |e *alias|Out, Boo|
|00000450| 6c 65 61 6e 20 69 73 46 | 6f 6c 64 65 72 4e 61 6d |lean isF|olderNam|
|00000460| 65 29 3b 0d 0d 0d 2f 2a | 20 64 6f 65 73 20 74 68 |e);.../*| does th|
|00000470| 65 20 66 6f 6c 64 65 72 | 20 68 61 76 65 20 61 20 |e folder| have a |
|00000480| 50 72 6f 6a 65 63 74 6f | 72 44 42 3f 20 2a 2f 0d |Projecto|rDB? */.|
|00000490| 09 0d 42 6f 6f 6c 65 61 | 6e 20 49 73 50 72 6f 6a |..Boolea|n IsProj|
|000004a0| 65 63 74 6f 72 46 6f 6c | 64 65 72 28 73 68 6f 72 |ectorFol|der(shor|
|000004b0| 74 20 76 52 65 66 4e 75 | 6d 2c 20 6c 6f 6e 67 20 |t vRefNu|m, long |
|000004c0| 66 6f 6c 64 65 72 49 44 | 29 0d 7b 0d 09 43 49 6e |folderID|).{..CIn|
|000004d0| 66 6f 50 42 52 65 63 20 | 70 62 3b 0d 09 4f 53 45 |foPBRec |pb;..OSE|
|000004e0| 72 72 20 65 72 72 3b 0d | 09 0d 09 70 62 2e 68 46 |rr err;.|...pb.hF|
|000004f0| 69 6c 65 49 6e 66 6f 2e | 69 6f 4e 61 6d 65 50 74 |ileInfo.|ioNamePt|
|00000500| 72 20 3d 20 22 5c 70 50 | 72 6f 6a 65 63 74 6f 72 |r = "\pP|rojector|
|00000510| 44 42 22 3b 0d 09 70 62 | 2e 68 46 69 6c 65 49 6e |DB";..pb|.hFileIn|
|00000520| 66 6f 2e 69 6f 56 52 65 | 66 4e 75 6d 20 3d 20 76 |fo.ioVRe|fNum = v|
|00000530| 52 65 66 4e 75 6d 3b 0d | 09 70 62 2e 68 46 69 6c |RefNum;.|.pb.hFil|
|00000540| 65 49 6e 66 6f 2e 69 6f | 44 69 72 49 44 20 3d 20 |eInfo.io|DirID = |
|00000550| 66 6f 6c 64 65 72 49 44 | 3b 0d 09 70 62 2e 68 46 |folderID|;..pb.hF|
|00000560| 69 6c 65 49 6e 66 6f 2e | 69 6f 46 44 69 72 49 6e |ileInfo.|ioFDirIn|
|00000570| 64 65 78 20 3d 20 30 3b | 0d 09 65 72 72 20 3d 20 |dex = 0;|..err = |
|00000580| 50 42 47 65 74 43 61 74 | 49 6e 66 6f 53 79 6e 63 |PBGetCat|InfoSync|
|00000590| 28 26 70 62 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |(&pb);..|if (err |
|000005a0| 21 3d 20 6e 6f 45 72 72 | 29 20 72 65 74 75 72 6e |!= noErr|) return|
|000005b0| 20 66 61 6c 73 65 3b 0d | 09 72 65 74 75 72 6e 20 | false;.|.return |
|000005c0| 70 62 2e 68 46 69 6c 65 | 49 6e 66 6f 2e 69 6f 46 |pb.hFile|Info.ioF|
|000005d0| 6c 46 6e 64 72 49 6e 66 | 6f 2e 66 64 54 79 70 65 |lFndrInf|o.fdType|
|000005e0| 20 3d 3d 20 27 4d 50 53 | 50 27 3b 0d 7d 0d 0d 0d | == 'MPS|P';.}...|
|000005f0| 2f 2a 20 4d 61 6b 65 20 | 61 6e 20 61 6c 69 61 73 |/* Make |an alias|
|00000600| 20 66 6f 72 20 61 20 70 | 72 6f 6a 65 63 74 6f 72 | for a p|rojector|
|00000610| 20 64 61 74 61 62 61 73 | 65 20 69 6e 20 74 68 65 | databas|e in the|
|00000620| 20 70 72 65 66 65 72 65 | 6e 63 65 73 20 66 6f 6c | prefere|nces fol|
|00000630| 64 65 72 0d 20 2a 20 73 | 6f 20 50 72 6f 6a 65 63 |der. * s|o Projec|
|00000640| 74 44 72 61 67 20 63 61 | 6e 20 64 65 61 6c 20 77 |tDrag ca|n deal w|
|00000650| 69 74 68 20 74 68 65 20 | 70 72 6f 6a 65 63 74 2e |ith the |project.|
|00000660| 0d 20 2a 2f 0d 0d 4f 53 | 45 72 72 20 4d 61 6b 65 |. */..OS|Err Make|
|00000670| 50 72 6f 6a 65 63 74 41 | 6c 69 61 73 28 73 68 6f |ProjectA|lias(sho|
|00000680| 72 74 20 76 52 65 66 4e | 75 6d 2c 20 6c 6f 6e 67 |rt vRefN|um, long|
|00000690| 20 66 6f 6c 64 65 72 49 | 44 2c 20 41 6c 69 61 73 | folderI|D, Alias|
|000006a0| 48 61 6e 64 6c 65 20 2a | 61 6c 69 61 73 4f 75 74 |Handle *|aliasOut|
|000006b0| 29 0d 7b 0d 09 41 6c 69 | 61 73 48 61 6e 64 6c 65 |).{..Ali|asHandle|
|000006c0| 20 61 6c 69 61 73 20 3d | 20 4e 55 4c 4c 3b 0d 09 | alias =| NULL;..|
|000006d0| 4f 53 45 72 72 20 65 72 | 72 20 3d 20 6e 6f 45 72 |OSErr er|r = noEr|
|000006e0| 72 3b 0d 09 46 53 53 70 | 65 63 20 61 6c 69 61 73 |r;..FSSp|ec alias|
|000006f0| 46 69 6c 65 3b 0d 09 46 | 53 53 70 65 63 20 70 72 |File;..F|SSpec pr|
|00000700| 6f 6a 65 63 74 46 69 6c | 65 3b 0d 09 73 68 6f 72 |ojectFil|e;..shor|
|00000710| 74 20 72 65 73 52 65 66 | 4e 75 6d 3b 0d 09 6c 6f |t resRef|Num;..lo|
|00000720| 6e 67 20 74 65 73 74 46 | 6f 6c 64 65 72 49 44 3b |ng testF|olderID;|
|00000730| 0d 09 42 6f 6f 6c 65 61 | 6e 20 76 65 72 69 66 69 |..Boolea|n verifi|
|00000740| 65 64 20 3d 20 66 61 6c | 73 65 3b 0d 09 0d 09 69 |ed = fal|se;....i|
|00000750| 66 20 28 61 6c 69 61 73 | 4f 75 74 20 21 3d 20 4e |f (alias|Out != N|
|00000760| 55 4c 4c 29 0d 09 09 2a | 61 6c 69 61 73 4f 75 74 |ULL)...*|aliasOut|
|00000770| 20 3d 20 4e 55 4c 4c 3b | 0d 09 0d 09 2f 2a 20 53 | = NULL;|..../* S|
|00000780| 69 6e 63 65 20 70 65 6f | 70 6c 65 20 61 72 65 20 |ince peo|ple are |
|00000790| 68 75 6d 61 6e 2c 20 74 | 68 65 79 20 73 6f 6d 65 |human, t|hey some|
|000007a0| 74 69 6d 65 73 20 64 72 | 61 67 20 69 6e 20 6e 6f |times dr|ag in no|
|000007b0| 6e 2d 74 6f 70 6d 6f 73 | 74 20 70 72 6f 6a 65 63 |n-topmos|t projec|
|000007c0| 74 73 2e 0d 09 20 2a 20 | 54 68 61 74 27 73 20 4f |ts... * |That's O|
|000007d0| 4b 2e 20 49 74 65 72 61 | 74 65 20 75 70 20 74 6f |K. Itera|te up to|
|000007e0| 20 74 68 65 20 74 6f 70 | 2d 6c 65 76 65 6c 20 70 | the top|-level p|
|000007f0| 72 6f 6a 65 63 74 2e 20 | 57 65 20 61 73 73 75 6d |roject. |We assum|
|00000800| 65 20 74 68 61 74 20 61 | 6e 79 0d 09 20 2a 20 66 |e that a|ny.. * f|
|00000810| 6f 6c 64 65 72 20 63 6f | 6e 74 61 69 6e 67 20 61 |older co|ntaing a|
|00000820| 20 50 72 6f 6a 65 63 74 | 6f 72 44 42 20 69 73 20 | Project|orDB is |
|00000830| 70 61 72 74 20 6f 66 20 | 61 20 68 69 65 72 61 72 |part of |a hierar|
|00000840| 63 68 79 2c 20 73 6f 20 | 69 66 20 74 68 65 20 70 |chy, so |if the p|
|00000850| 61 72 65 6e 74 0d 09 20 | 2a 20 63 6f 6e 74 61 69 |arent.. |* contai|
|00000860| 6e 73 20 6f 6e 65 2c 20 | 77 65 20 6c 6f 6f 70 20 |ns one, |we loop |
|00000870| 75 70 77 61 72 64 73 2e | 0d 09 20 2a 2f 0d 09 74 |upwards.|.. */..t|
|00000880| 65 73 74 46 6f 6c 64 65 | 72 49 44 20 3d 20 66 6f |estFolde|rID = fo|
|00000890| 6c 64 65 72 49 44 3b 0d | 09 77 68 69 6c 65 20 28 |lderID;.|.while (|
|000008a0| 49 73 50 72 6f 6a 65 63 | 74 6f 72 46 6f 6c 64 65 |IsProjec|torFolde|
|000008b0| 72 28 76 52 65 66 4e 75 | 6d 2c 20 74 65 73 74 46 |r(vRefNu|m, testF|
|000008c0| 6f 6c 64 65 72 49 44 29 | 29 0d 09 7b 0d 09 09 43 |olderID)|)..{...C|
|000008d0| 49 6e 66 6f 50 42 52 65 | 63 20 70 62 3b 0d 09 09 |InfoPBRe|c pb;...|
|000008e0| 0d 09 09 2f 2a 20 74 68 | 65 20 70 72 65 76 69 6f |.../* th|e previo|
|000008f0| 75 73 6c 79 20 63 68 65 | 63 6b 65 64 20 66 6f 6c |usly che|cked fol|
|00000900| 64 65 72 20 77 61 73 20 | 69 6e 64 65 65 64 20 61 |der was |indeed a|
|00000910| 20 50 72 6f 6a 65 63 74 | 6f 72 20 66 6f 6c 64 65 | Project|or folde|
|00000920| 72 20 2a 2f 0d 09 09 76 | 65 72 69 66 69 65 64 20 |r */...v|erified |
|00000930| 3d 20 74 72 75 65 3b 0d | 09 09 66 6f 6c 64 65 72 |= true;.|..folder|
|00000940| 49 44 20 3d 20 74 65 73 | 74 46 6f 6c 64 65 72 49 |ID = tes|tFolderI|
|00000950| 44 3b 0d 09 09 0d 09 09 | 2f 2a 20 67 65 74 20 74 |D;......|/* get t|
|00000960| 68 65 20 70 61 72 65 6e | 74 20 66 6f 6c 64 65 72 |he paren|t folder|
|00000970| 20 66 6f 72 20 74 68 65 | 20 6e 65 78 74 20 74 65 | for the| next te|
|00000980| 73 74 20 2a 2f 0d 09 09 | 70 62 2e 68 46 69 6c 65 |st */...|pb.hFile|
|00000990| 49 6e 66 6f 2e 69 6f 4e | 61 6d 65 50 74 72 20 3d |Info.ioN|amePtr =|
|000009a0| 20 4e 55 4c 4c 3b 0d 09 | 09 70 62 2e 68 46 69 6c | NULL;..|.pb.hFil|
|000009b0| 65 49 6e 66 6f 2e 69 6f | 56 52 65 66 4e 75 6d 20 |eInfo.io|VRefNum |
|000009c0| 3d 20 76 52 65 66 4e 75 | 6d 3b 0d 09 09 70 62 2e |= vRefNu|m;...pb.|
|000009d0| 68 46 69 6c 65 49 6e 66 | 6f 2e 69 6f 44 69 72 49 |hFileInf|o.ioDirI|
|000009e0| 44 20 3d 20 74 65 73 74 | 46 6f 6c 64 65 72 49 44 |D = test|FolderID|
|000009f0| 3b 0d 09 09 70 62 2e 68 | 46 69 6c 65 49 6e 66 6f |;...pb.h|FileInfo|
|00000a00| 2e 69 6f 46 44 69 72 49 | 6e 64 65 78 20 3d 20 2d |.ioFDirI|ndex = -|
|00000a10| 31 3b 0d 09 09 65 72 72 | 20 3d 20 50 42 47 65 74 |1;...err| = PBGet|
|00000a20| 43 61 74 49 6e 66 6f 53 | 79 6e 63 28 26 70 62 29 |CatInfoS|ync(&pb)|
|00000a30| 3b 0d 09 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |;...if (|err != n|
|00000a40| 6f 45 72 72 29 20 62 72 | 65 61 6b 3b 0d 09 09 74 |oErr) br|eak;...t|
|00000a50| 65 73 74 46 6f 6c 64 65 | 72 49 44 20 3d 20 70 62 |estFolde|rID = pb|
|00000a60| 2e 64 69 72 49 6e 66 6f | 2e 69 6f 44 72 50 61 72 |.dirInfo|.ioDrPar|
|00000a70| 49 44 3b 0d 09 7d 0d 09 | 69 66 20 28 21 76 65 72 |ID;..}..|if (!ver|
|00000a80| 69 66 69 65 64 29 20 72 | 65 74 75 72 6e 20 66 6e |ified) r|eturn fn|
|00000a90| 66 45 72 72 3b 0d 0d 09 | 2f 2a 20 67 65 74 20 74 |fErr;...|/* get t|
|00000aa0| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 70 |he name |of the p|
|00000ab0| 72 6f 6a 65 63 74 6f 72 | 20 66 6f 6c 64 65 72 20 |rojector| folder |
|00000ac0| 2a 2f 0d 09 65 72 72 20 | 3d 20 46 69 6e 64 50 72 |*/..err |= FindPr|
|00000ad0| 65 66 65 72 65 6e 63 65 | 73 46 6f 6c 64 65 72 28 |eference|sFolder(|
|00000ae0| 26 61 6c 69 61 73 46 69 | 6c 65 2e 76 52 65 66 4e |&aliasFi|le.vRefN|
|00000af0| 75 6d 2c 20 26 61 6c 69 | 61 73 46 69 6c 65 2e 70 |um, &ali|asFile.p|
|00000b00| 61 72 49 44 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |arID);..|if (err |
|00000b10| 21 3d 20 6e 6f 45 72 72 | 29 20 72 65 74 75 72 6e |!= noErr|) return|
|00000b20| 20 65 72 72 3b 0d 09 65 | 72 72 20 3d 20 47 65 74 | err;..e|rr = Get|
|00000b30| 44 69 72 4e 61 6d 65 28 | 76 52 65 66 4e 75 6d 2c |DirName(|vRefNum,|
|00000b40| 20 66 6f 6c 64 65 72 49 | 44 2c 20 61 6c 69 61 73 | folderI|D, alias|
|00000b50| 46 69 6c 65 2e 6e 61 6d | 65 29 3b 0d 09 69 66 20 |File.nam|e);..if |
|00000b60| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 72 |(err != |noErr) r|
|00000b70| 65 74 75 72 6e 20 65 72 | 72 3b 0d 09 0d 09 2f 2a |eturn er|r;..../*|
|00000b80| 20 6d 61 6b 65 20 74 68 | 65 20 61 6c 69 61 73 20 | make th|e alias |
|00000b90| 2a 2f 0d 09 70 72 6f 6a | 65 63 74 46 69 6c 65 2e |*/..proj|ectFile.|
|00000ba0| 76 52 65 66 4e 75 6d 20 | 3d 20 76 52 65 66 4e 75 |vRefNum |= vRefNu|
|00000bb0| 6d 3b 0d 09 70 72 6f 6a | 65 63 74 46 69 6c 65 2e |m;..proj|ectFile.|
|00000bc0| 70 61 72 49 44 20 3d 20 | 66 6f 6c 64 65 72 49 44 |parID = |folderID|
|00000bd0| 3b 0d 09 70 72 6f 6a 65 | 63 74 46 69 6c 65 2e 6e |;..proje|ctFile.n|
|00000be0| 61 6d 65 5b 30 5d 20 3d | 20 30 3b 0d 09 65 72 72 |ame[0] =| 0;..err|
|00000bf0| 20 3d 20 4e 65 77 41 6c | 69 61 73 28 4e 55 4c 4c | = NewAl|ias(NULL|
|00000c00| 2c 20 26 70 72 6f 6a 65 | 63 74 46 69 6c 65 2c 20 |, &proje|ctFile, |
|00000c10| 26 61 6c 69 61 73 29 3b | 0d 09 69 66 20 28 65 72 |&alias);|..if (er|
|00000c20| 72 20 21 3d 20 6e 6f 45 | 72 72 29 20 72 65 74 75 |r != noE|rr) retu|
|00000c30| 72 6e 20 65 72 72 3b 0d | 09 0d 09 2f 2a 20 6d 61 |rn err;.|.../* ma|
|00000c40| 6b 65 20 74 68 65 20 61 | 6c 69 61 73 20 66 69 6c |ke the a|lias fil|
|00000c50| 65 0d 09 20 2a 0d 09 20 | 2a 20 6e 6f 74 65 20 2d |e.. *.. |* note -|
|00000c60| 2d 20 6f 66 66 69 63 69 | 61 6c 6c 79 20 74 68 65 |- offici|ally the|
|00000c70| 20 66 6f 72 6d 61 74 20 | 6f 66 20 61 6c 69 61 73 | format |of alias|
|00000c80| 20 66 69 6c 65 73 20 69 | 73 20 70 72 69 76 61 74 | files i|s privat|
|00000c90| 65 2e 20 59 6f 75 20 73 | 68 6f 75 6c 64 20 6f 6e |e. You s|hould on|
|00000ca0| 6c 79 0d 09 20 2a 20 63 | 72 65 61 74 65 20 74 68 |ly.. * c|reate th|
|00000cb0| 65 6d 20 62 79 20 73 65 | 6e 64 69 6e 67 20 61 20 |em by se|nding a |
|00000cc0| 4d 61 6b 65 20 41 6c 69 | 61 73 20 41 70 70 6c 65 |Make Ali|as Apple|
|00000cd0| 20 45 76 65 6e 74 20 74 | 6f 20 74 68 65 20 46 69 | Event t|o the Fi|
|00000ce0| 6e 64 65 72 2e 20 4d 61 | 79 62 65 20 69 6e 0d 09 |nder. Ma|ybe in..|
|00000cf0| 20 2a 20 50 72 6f 6a 65 | 63 74 44 72 61 67 20 31 | * Proje|ctDrag 1|
|00000d00| 2e 31 2e 20 4a 75 73 74 | 20 64 6f 6e 27 74 20 77 |.1. Just| don't w|
|00000d10| 61 76 65 20 74 68 69 73 | 20 61 72 6f 75 6e 64 20 |ave this| around |
|00000d20| 61 6e 64 20 73 61 79 20 | 41 70 70 6c 65 20 65 6e |and say |Apple en|
|00000d30| 64 6f 72 73 65 73 20 74 | 68 69 73 0d 09 20 2a 20 |dorses t|his.. * |
|00000d40| 70 72 61 63 74 69 63 65 | 2e 20 49 74 20 64 6f 65 |practice|. It doe|
|00000d50| 73 6e 27 74 21 0d 09 20 | 2a 0d 09 20 2a 2f 0d 09 |sn't!.. |*.. */..|
|00000d60| 46 53 70 43 72 65 61 74 | 65 52 65 73 46 69 6c 65 |FSpCreat|eResFile|
|00000d70| 28 26 61 6c 69 61 73 46 | 69 6c 65 2c 20 6b 53 6f |(&aliasF|ile, kSo|
|00000d80| 75 72 63 65 53 65 72 76 | 65 72 43 72 65 61 74 6f |urceServ|erCreato|
|00000d90| 72 2c 20 6b 53 6f 75 72 | 63 65 53 65 72 76 65 72 |r, kSour|ceServer|
|00000da0| 54 79 70 65 2c 20 73 6d | 53 79 73 74 65 6d 53 63 |Type, sm|SystemSc|
|00000db0| 72 69 70 74 29 3b 0d 09 | 65 72 72 20 3d 20 52 65 |ript);..|err = Re|
|00000dc0| 73 45 72 72 6f 72 28 29 | 3b 0d 09 69 66 20 28 65 |sError()|;..if (e|
|00000dd0| 72 72 20 3d 3d 20 64 75 | 70 46 4e 45 72 72 29 0d |rr == du|pFNErr).|
|00000de0| 09 7b 0d 09 09 2f 2a 20 | 61 6c 69 61 73 20 61 6c |.{.../* |alias al|
|00000df0| 72 65 61 64 79 20 65 78 | 69 73 74 73 20 2d 2d 20 |ready ex|ists -- |
|00000e00| 64 65 6c 65 74 65 20 69 | 74 20 26 20 63 72 65 61 |delete i|t & crea|
|00000e10| 74 65 20 6e 65 77 20 6f | 6e 65 20 2a 2f 0d 09 09 |te new o|ne */...|
|00000e20| 46 53 70 44 65 6c 65 74 | 65 28 26 61 6c 69 61 73 |FSpDelet|e(&alias|
|00000e30| 46 69 6c 65 29 3b 0d 09 | 09 46 53 70 43 72 65 61 |File);..|.FSpCrea|
|00000e40| 74 65 52 65 73 46 69 6c | 65 28 26 61 6c 69 61 73 |teResFil|e(&alias|
|00000e50| 46 69 6c 65 2c 20 6b 53 | 6f 75 72 63 65 53 65 72 |File, kS|ourceSer|
|00000e60| 76 65 72 43 72 65 61 74 | 6f 72 2c 20 6b 53 6f 75 |verCreat|or, kSou|
|00000e70| 72 63 65 53 65 72 76 65 | 72 54 79 70 65 2c 20 73 |rceServe|rType, s|
|00000e80| 6d 53 79 73 74 65 6d 53 | 63 72 69 70 74 29 3b 0d |mSystemS|cript);.|
|00000e90| 09 09 65 72 72 20 3d 20 | 52 65 73 45 72 72 6f 72 |..err = |ResError|
|00000ea0| 28 29 3b 0d 09 7d 0d 09 | 69 66 20 28 65 72 72 20 |();..}..|if (err |
|00000eb0| 21 3d 20 6e 6f 45 72 72 | 29 0d 09 7b 0d 09 09 44 |!= noErr|)..{...D|
|00000ec0| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 28 48 61 |isposeHa|ndle((Ha|
|00000ed0| 6e 64 6c 65 29 61 6c 69 | 61 73 29 3b 0d 09 09 72 |ndle)ali|as);...r|
|00000ee0| 65 74 75 72 6e 20 65 72 | 72 3b 0d 09 7d 0d 09 0d |eturn er|r;..}...|
|00000ef0| 09 2f 2a 20 6f 70 65 6e | 20 74 68 65 20 61 6c 69 |./* open| the ali|
|00000f00| 61 73 20 66 69 6c 65 20 | 2a 2f 0d 09 72 65 73 52 |as file |*/..resR|
|00000f10| 65 66 4e 75 6d 20 3d 20 | 46 53 70 4f 70 65 6e 52 |efNum = |FSpOpenR|
|00000f20| 65 73 46 69 6c 65 28 26 | 61 6c 69 61 73 46 69 6c |esFile(&|aliasFil|
|00000f30| 65 2c 20 66 73 52 64 57 | 72 50 65 72 6d 29 3b 0d |e, fsRdW|rPerm);.|
|00000f40| 09 69 66 20 28 72 65 73 | 52 65 66 4e 75 6d 20 3c |.if (res|RefNum <|
|00000f50| 20 30 29 0d 09 7b 0d 09 | 09 65 72 72 20 3d 20 52 | 0)..{..|.err = R|
|00000f60| 65 73 45 72 72 6f 72 28 | 29 3b 0d 09 09 44 69 73 |esError(|);...Dis|
|00000f70| 70 6f 73 65 48 61 6e 64 | 6c 65 28 28 48 61 6e 64 |poseHand|le((Hand|
|00000f80| 6c 65 29 61 6c 69 61 73 | 29 3b 0d 09 09 46 53 70 |le)alias|);...FSp|
|00000f90| 44 65 6c 65 74 65 28 26 | 61 6c 69 61 73 46 69 6c |Delete(&|aliasFil|
|00000fa0| 65 29 3b 0d 09 09 72 65 | 74 75 72 6e 20 65 72 72 |e);...re|turn err|
|00000fb0| 3b 0d 09 7d 0d 09 0d 09 | 2f 2a 20 61 64 64 20 74 |;..}....|/* add t|
|00000fc0| 68 65 20 61 6c 69 61 73 | 20 72 65 73 6f 75 72 63 |he alias| resourc|
|00000fd0| 65 20 2a 2f 0d 09 41 64 | 64 52 65 73 6f 75 72 63 |e */..Ad|dResourc|
|00000fe0| 65 28 28 48 61 6e 64 6c | 65 29 61 6c 69 61 73 2c |e((Handl|e)alias,|
|00000ff0| 20 27 61 6c 69 73 27 2c | 20 30 2c 20 22 5c 70 22 | 'alis',| 0, "\p"|
|00001000| 29 3b 0d 09 65 72 72 20 | 3d 20 52 65 73 45 72 72 |);..err |= ResErr|
|00001010| 6f 72 28 29 3b 0d 09 69 | 66 20 28 65 72 72 20 21 |or();..i|f (err !|
|00001020| 3d 20 6e 6f 45 72 72 29 | 0d 09 7b 0d 09 09 43 6c |= noErr)|..{...Cl|
|00001030| 6f 73 65 52 65 73 46 69 | 6c 65 28 72 65 73 52 65 |oseResFi|le(resRe|
|00001040| 66 4e 75 6d 29 3b 0d 09 | 09 44 69 73 70 6f 73 65 |fNum);..|.Dispose|
|00001050| 48 61 6e 64 6c 65 28 28 | 48 61 6e 64 6c 65 29 61 |Handle((|Handle)a|
|00001060| 6c 69 61 73 29 3b 0d 09 | 09 46 53 70 44 65 6c 65 |lias);..|.FSpDele|
|00001070| 74 65 28 26 61 6c 69 61 | 73 46 69 6c 65 29 3b 0d |te(&alia|sFile);.|
|00001080| 09 09 72 65 74 75 72 6e | 20 65 72 72 3b 0d 09 7d |..return| err;..}|
|00001090| 0d 09 69 66 20 28 61 6c | 69 61 73 4f 75 74 20 21 |..if (al|iasOut !|
|000010a0| 3d 20 4e 55 4c 4c 29 0d | 09 7b 0d 09 09 2a 61 6c |= NULL).|.{...*al|
|000010b0| 69 61 73 4f 75 74 20 3d | 20 61 6c 69 61 73 3b 0d |iasOut =| alias;.|
|000010c0| 09 09 65 72 72 20 3d 20 | 48 61 6e 64 54 6f 48 61 |..err = |HandToHa|
|000010d0| 6e 64 28 28 48 61 6e 64 | 6c 65 2a 29 61 6c 69 61 |nd((Hand|le*)alia|
|000010e0| 73 4f 75 74 29 3b 0d 09 | 09 69 66 20 28 65 72 72 |sOut);..|.if (err|
|000010f0| 20 21 3d 20 6e 6f 45 72 | 72 29 0d 09 09 7b 0d 09 | != noEr|r)...{..|
|00001100| 09 09 43 6c 6f 73 65 52 | 65 73 46 69 6c 65 28 72 |..CloseR|esFile(r|
|00001110| 65 73 52 65 66 4e 75 6d | 29 3b 0d 09 09 09 2a 61 |esRefNum|);....*a|
|00001120| 6c 69 61 73 4f 75 74 20 | 3d 20 4e 55 4c 4c 3b 0d |liasOut |= NULL;.|
|00001130| 09 09 09 72 65 74 75 72 | 6e 20 65 72 72 3b 0d 09 |...retur|n err;..|
|00001140| 09 7d 0d 09 7d 0d 09 43 | 6c 6f 73 65 52 65 73 46 |.}..}..C|loseResF|
|00001150| 69 6c 65 28 72 65 73 52 | 65 66 4e 75 6d 29 3b 0d |ile(resR|efNum);.|
|00001160| 09 0d 09 2f 2a 20 74 75 | 72 6e 20 69 74 20 69 6e |.../* tu|rn it in|
|00001170| 74 6f 20 61 6e 20 61 6c | 69 61 73 20 66 69 6c 65 |to an al|ias file|
|00001180| 2c 20 6e 61 6d 65 20 6c | 6f 63 6b 65 64 2c 20 6e |, name l|ocked, n|
|00001190| 6f 74 20 79 65 74 20 69 | 6e 69 74 65 64 20 2a 2f |ot yet i|nited */|
|000011a0| 0d 09 65 72 72 20 3d 20 | 46 53 70 43 68 61 6e 67 |..err = |FSpChang|
|000011b0| 65 46 44 46 6c 61 67 73 | 28 26 61 6c 69 61 73 46 |eFDFlags|(&aliasF|
|000011c0| 69 6c 65 2c 20 74 72 75 | 65 2c 20 6b 49 73 41 6c |ile, tru|e, kIsAl|
|000011d0| 69 61 73 20 7c 20 6b 4e | 61 6d 65 4c 6f 63 6b 65 |ias | kN|ameLocke|
|000011e0| 64 29 3b 0d 09 69 66 20 | 28 65 72 72 20 3d 3d 20 |d);..if |(err == |
|000011f0| 6e 6f 45 72 72 29 0d 09 | 09 65 72 72 20 3d 20 46 |noErr)..|.err = F|
|00001200| 53 70 43 68 61 6e 67 65 | 46 44 46 6c 61 67 73 28 |SpChange|FDFlags(|
|00001210| 26 61 6c 69 61 73 46 69 | 6c 65 2c 20 66 61 6c 73 |&aliasFi|le, fals|
|00001220| 65 2c 20 6b 48 61 73 42 | 65 65 6e 49 6e 69 74 65 |e, kHasB|eenInite|
|00001230| 64 29 3b 0d 09 69 66 20 | 28 65 72 72 20 21 3d 20 |d);..if |(err != |
|00001240| 6e 6f 45 72 72 29 0d 09 | 7b 0d 09 09 46 53 70 44 |noErr)..|{...FSpD|
|00001250| 65 6c 65 74 65 28 26 61 | 6c 69 61 73 46 69 6c 65 |elete(&a|liasFile|
|00001260| 29 3b 0d 09 09 69 66 20 | 28 61 6c 69 61 73 4f 75 |);...if |(aliasOu|
|00001270| 74 20 21 3d 20 4e 55 4c | 4c 29 0d 09 09 7b 0d 09 |t != NUL|L)...{..|
|00001280| 09 09 44 69 73 70 6f 73 | 65 48 61 6e 64 6c 65 28 |..Dispos|eHandle(|
|00001290| 28 48 61 6e 64 6c 65 29 | 2a 61 6c 69 61 73 4f 75 |(Handle)|*aliasOu|
|000012a0| 74 29 3b 0d 09 09 09 2a | 61 6c 69 61 73 4f 75 74 |t);....*|aliasOut|
|000012b0| 20 3d 20 4e 55 4c 4c 3b | 0d 09 09 7d 0d 09 09 72 | = NULL;|...}...r|
|000012c0| 65 74 75 72 6e 20 65 72 | 72 3b 0d 09 7d 0d 09 72 |eturn er|r;..}..r|
|000012d0| 65 74 75 72 6e 20 6e 6f | 45 72 72 3b 0d 7d 0d 0d |eturn no|Err;.}..|
|000012e0| 0d 2f 2a 20 73 65 65 20 | 6e 6f 74 65 20 61 62 6f |./* see |note abo|
|000012f0| 76 65 20 2d 2d 20 6f 66 | 66 69 63 69 61 6c 6c 79 |ve -- of|ficially|
|00001300| 2c 20 67 65 74 74 69 6e | 67 20 61 6e 20 61 6c 69 |, gettin|g an ali|
|00001310| 61 73 20 66 72 6f 6d 20 | 61 20 66 69 6c 65 20 74 |as from |a file t|
|00001320| 68 69 73 20 77 61 79 20 | 69 73 20 6e 61 75 67 68 |his way |is naugh|
|00001330| 74 79 2e 0d 20 2a 20 48 | 6f 77 65 76 65 72 2c 20 |ty.. * H|owever, |
|00001340| 52 65 73 6f 6c 76 65 41 | 6c 69 61 73 46 69 6c 65 |ResolveA|liasFile|
|00001350| 20 64 6f 65 73 6e 27 74 | 20 67 69 76 65 20 61 6e | doesn't| give an|
|00001360| 79 20 63 6f 6e 74 72 6f | 6c 20 6f 76 65 72 20 74 |y contro|l over t|
|00001370| 68 65 20 66 6c 61 67 73 | 20 74 6f 20 4d 61 74 63 |he flags| to Matc|
|00001380| 68 41 6c 69 61 73 2c 0d | 20 2a 20 6f 72 20 65 76 |hAlias,.| * or ev|
|00001390| 65 6e 20 67 69 76 65 20 | 79 6f 75 20 74 68 65 20 |en give |you the |
|000013a0| 61 6c 69 61 73 20 68 61 | 6e 64 6c 65 2c 20 6f 6e |alias ha|ndle, on|
|000013b0| 20 77 68 69 63 68 20 77 | 65 20 63 61 6c 6c 20 47 | which w|e call G|
|000013c0| 65 74 41 6c 69 61 73 49 | 6e 66 6f 2e 20 53 6f 72 |etAliasI|nfo. Sor|
|000013d0| 72 79 21 0d 20 2a 2f 0d | 20 0d 4f 53 45 72 72 20 |ry!. */.| .OSErr |
|000013e0| 47 65 74 41 6c 69 61 73 | 46 72 6f 6d 46 69 6c 65 |GetAlias|FromFile|
|000013f0| 28 46 53 53 70 65 63 20 | 2a 66 69 6c 65 2c 20 41 |(FSSpec |*file, A|
|00001400| 6c 69 61 73 48 61 6e 64 | 6c 65 20 2a 61 6c 69 61 |liasHand|le *alia|
|00001410| 73 4f 75 74 29 0d 7b 0d | 09 73 68 6f 72 74 20 72 |sOut).{.|.short r|
|00001420| 65 73 52 65 66 4e 75 6d | 3b 0d 09 41 6c 69 61 73 |esRefNum|;..Alias|
|00001430| 48 61 6e 64 6c 65 20 61 | 6c 69 61 73 3b 0d 09 46 |Handle a|lias;..F|
|00001440| 53 53 70 65 63 20 61 6c | 69 61 73 46 69 6c 65 3b |SSpec al|iasFile;|
|00001450| 0d 09 0d 09 61 6c 69 61 | 73 46 69 6c 65 2e 76 52 |....alia|sFile.vR|
|00001460| 65 66 4e 75 6d 20 3d 20 | 66 69 6c 65 2d 3e 76 52 |efNum = |file->vR|
|00001470| 65 66 4e 75 6d 3b 0d 09 | 61 6c 69 61 73 46 69 6c |efNum;..|aliasFil|
|00001480| 65 2e 70 61 72 49 44 20 | 3d 20 66 69 6c 65 2d 3e |e.parID |= file->|
|00001490| 70 61 72 49 44 3b 0d 09 | 42 6c 6f 63 6b 4d 6f 76 |parID;..|BlockMov|
|000014a0| 65 28 66 69 6c 65 2d 3e | 6e 61 6d 65 2c 20 61 6c |e(file->|name, al|
|000014b0| 69 61 73 46 69 6c 65 2e | 6e 61 6d 65 2c 20 66 69 |iasFile.|name, fi|
|000014c0| 6c 65 2d 3e 6e 61 6d 65 | 5b 30 5d 20 2b 20 31 29 |le->name|[0] + 1)|
|000014d0| 3b 0d 09 72 65 73 52 65 | 66 4e 75 6d 20 3d 20 46 |;..resRe|fNum = F|
|000014e0| 53 70 4f 70 65 6e 52 65 | 73 46 69 6c 65 28 26 61 |SpOpenRe|sFile(&a|
|000014f0| 6c 69 61 73 46 69 6c 65 | 2c 20 66 73 52 64 50 65 |liasFile|, fsRdPe|
|00001500| 72 6d 29 3b 0d 09 69 66 | 20 28 72 65 73 52 65 66 |rm);..if| (resRef|
|00001510| 4e 75 6d 20 3c 20 30 29 | 0d 09 09 72 65 74 75 72 |Num < 0)|...retur|
|00001520| 6e 20 52 65 73 45 72 72 | 6f 72 28 29 3b 0d 09 61 |n ResErr|or();..a|
|00001530| 6c 69 61 73 20 3d 20 28 | 41 6c 69 61 73 48 61 6e |lias = (|AliasHan|
|00001540| 64 6c 65 29 47 65 74 31 | 49 6e 64 52 65 73 6f 75 |dle)Get1|IndResou|
|00001550| 72 63 65 28 27 61 6c 69 | 73 27 2c 20 31 29 3b 0d |rce('ali|s', 1);.|
|00001560| 09 69 66 20 28 61 6c 69 | 61 73 20 3d 3d 20 4e 55 |.if (ali|as == NU|
|00001570| 4c 4c 29 0d 09 7b 0d 09 | 09 43 6c 6f 73 65 52 65 |LL)..{..|.CloseRe|
|00001580| 73 46 69 6c 65 28 72 65 | 73 52 65 66 4e 75 6d 29 |sFile(re|sRefNum)|
|00001590| 3b 0d 09 09 46 53 70 44 | 65 6c 65 74 65 28 26 61 |;...FSpD|elete(&a|
|000015a0| 6c 69 61 73 46 69 6c 65 | 29 3b 20 2f 2a 20 62 61 |liasFile|); /* ba|
|000015b0| 64 20 66 69 6c 65 20 2d | 2d 20 6b 69 6c 6c 20 69 |d file -|- kill i|
|000015c0| 74 20 2a 2f 0d 09 09 72 | 65 74 75 72 6e 20 72 65 |t */...r|eturn re|
|000015d0| 73 4e 6f 74 46 6f 75 6e | 64 3b 0d 09 7d 0d 09 44 |sNotFoun|d;..}..D|
|000015e0| 65 74 61 63 68 52 65 73 | 6f 75 72 63 65 28 28 48 |etachRes|ource((H|
|000015f0| 61 6e 64 6c 65 29 61 6c | 69 61 73 29 3b 0d 09 2a |andle)al|ias);..*|
|00001600| 61 6c 69 61 73 4f 75 74 | 20 3d 20 61 6c 69 61 73 |aliasOut| = alias|
|00001610| 3b 0d 09 43 6c 6f 73 65 | 52 65 73 46 69 6c 65 28 |;..Close|ResFile(|
|00001620| 72 65 73 52 65 66 4e 75 | 6d 29 3b 0d 09 72 65 74 |resRefNu|m);..ret|
|00001630| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 7d 0d 0d 0d 2f |urn noEr|r;.}.../|
|00001640| 2a 20 53 74 72 69 70 20 | 74 68 65 20 6e 61 6d 65 |* Strip |the name|
|00001650| 20 6f 66 20 74 68 65 20 | 6c 65 61 64 69 6e 67 20 | of the |leading |
|00001660| 70 72 6f 6a 65 63 74 20 | 66 72 6f 6d 20 61 20 66 |project |from a f|
|00001670| 75 6c 6c 20 70 72 6f 6a | 65 63 74 20 6e 61 6d 65 |ull proj|ect name|
|00001680| 20 2a 2f 0d 0d 76 6f 69 | 64 20 47 65 74 54 6f 70 | */..voi|d GetTop|
|00001690| 50 72 6f 6a 65 63 74 4e | 61 6d 65 28 53 74 72 69 |ProjectN|ame(Stri|
|000016a0| 6e 67 50 74 72 20 70 72 | 6f 6a 65 63 74 4e 61 6d |ngPtr pr|ojectNam|
|000016b0| 65 2c 20 53 74 72 69 6e | 67 50 74 72 20 74 6f 70 |e, Strin|gPtr top|
|000016c0| 50 72 6f 6a 65 63 74 4e | 61 6d 65 29 0d 7b 0d 09 |ProjectN|ame).{..|
|000016d0| 53 74 72 69 6e 67 50 74 | 72 20 73 72 63 20 3d 20 |StringPt|r src = |
|000016e0| 70 72 6f 6a 65 63 74 4e | 61 6d 65 20 2b 20 31 3b |projectN|ame + 1;|
|000016f0| 0d 09 53 74 72 69 6e 67 | 50 74 72 20 64 73 74 20 |..String|Ptr dst |
|00001700| 3d 20 74 6f 70 50 72 6f | 6a 65 63 74 4e 61 6d 65 |= topPro|jectName|
|00001710| 20 2b 20 31 3b 0d 09 73 | 68 6f 72 74 20 6c 65 6e | + 1;..s|hort len|
|00001720| 20 3d 20 70 72 6f 6a 65 | 63 74 4e 61 6d 65 5b 30 | = proje|ctName[0|
|00001730| 5d 3b 0d 09 73 68 6f 72 | 74 20 69 3b 0d 09 0d 09 |];..shor|t i;....|
|00001740| 74 6f 70 50 72 6f 6a 65 | 63 74 4e 61 6d 65 5b 30 |topProje|ctName[0|
|00001750| 5d 20 3d 20 30 3b 0d 09 | 66 6f 72 20 28 69 20 3d |] = 0;..|for (i =|
|00001760| 20 30 3b 20 69 20 3c 20 | 6c 65 6e 3b 20 69 2b 2b | 0; i < |len; i++|
|00001770| 29 0d 09 7b 0d 09 09 69 | 66 20 28 2a 73 72 63 20 |)..{...i|f (*src |
|00001780| 3d 3d 20 6b 50 72 6f 6a | 65 63 74 6f 72 50 61 74 |== kProj|ectorPat|
|00001790| 68 53 65 70 61 72 61 74 | 6f 72 29 0d 09 09 09 62 |hSeparat|or)....b|
|000017a0| 72 65 61 6b 3b 0d 09 09 | 2a 64 73 74 2b 2b 20 3d |reak;...|*dst++ =|
|000017b0| 20 2a 73 72 63 2b 2b 3b | 0d 09 09 74 6f 70 50 72 | *src++;|...topPr|
|000017c0| 6f 6a 65 63 74 4e 61 6d | 65 5b 30 5d 2b 2b 3b 0d |ojectNam|e[0]++;.|
|000017d0| 09 7d 0d 7d 0d 0d 0d 2f | 2a 20 67 65 74 20 61 20 |.}.}.../|* get a |
|000017e0| 70 72 6f 6a 65 63 74 20 | 6e 61 6d 65 20 66 72 6f |project |name fro|
|000017f0| 6d 20 61 20 43 4b 49 44 | 20 72 65 73 6f 75 72 63 |m a CKID| resourc|
|00001800| 65 20 2a 2f 0d 0d 4f 53 | 45 72 72 20 46 69 6e 64 |e */..OS|Err Find|
|00001810| 50 72 6f 6a 65 63 74 41 | 6c 69 61 73 46 72 6f 6d |ProjectA|liasFrom|
|00001820| 43 4b 49 44 28 43 4b 49 | 44 48 61 6e 64 6c 65 20 |CKID(CKI|DHandle |
|00001830| 74 68 65 43 4b 49 44 2c | 20 41 6c 69 61 73 48 61 |theCKID,| AliasHa|
|00001840| 6e 64 6c 65 20 2a 61 6c | 69 61 73 4f 75 74 2c 20 |ndle *al|iasOut, |
|00001850| 53 74 72 69 6e 67 50 74 | 72 20 70 72 6f 6a 65 63 |StringPt|r projec|
|00001860| 74 4e 61 6d 65 29 0d 7b | 0d 09 53 74 72 33 31 20 |tName).{|..Str31 |
|00001870| 74 6f 70 50 72 6f 6a 65 | 63 74 4e 61 6d 65 3b 0d |topProje|ctName;.|
|00001880| 09 53 74 72 33 31 20 72 | 65 61 6c 50 72 6f 6a 65 |.Str31 r|ealProje|
|00001890| 63 74 4e 61 6d 65 3b 0d | 0d 09 2f 2a 20 65 78 74 |ctName;.|../* ext|
|000018a0| 72 61 63 74 20 74 68 65 | 20 70 72 6f 6a 65 63 74 |ract the| project|
|000018b0| 20 6e 61 6d 65 20 66 72 | 6f 6d 20 74 68 65 20 43 | name fr|om the C|
|000018c0| 4b 49 44 20 2a 2f 0d 09 | 42 6c 6f 63 6b 4d 6f 76 |KID */..|BlockMov|
|000018d0| 65 28 28 2a 74 68 65 43 | 4b 49 44 29 2d 3e 70 72 |e((*theC|KID)->pr|
|000018e0| 6f 6a 65 63 74 50 61 74 | 68 2c 20 70 72 6f 6a 65 |ojectPat|h, proje|
|000018f0| 63 74 4e 61 6d 65 2c 20 | 28 2a 74 68 65 43 4b 49 |ctName, |(*theCKI|
|00001900| 44 29 2d 3e 70 72 6f 6a | 65 63 74 50 61 74 68 5b |D)->proj|ectPath[|
|00001910| 30 5d 20 2b 20 31 29 3b | 0d 09 0d 09 2f 2a 20 66 |0] + 1);|..../* f|
|00001920| 69 6e 64 20 74 68 65 20 | 6c 65 61 64 69 6e 67 20 |ind the |leading |
|00001930| 70 72 6f 6a 65 63 74 20 | 6e 61 6d 65 20 2a 2f 0d |project |name */.|
|00001940| 09 47 65 74 54 6f 70 50 | 72 6f 6a 65 63 74 4e 61 |.GetTopP|rojectNa|
|00001950| 6d 65 28 70 72 6f 6a 65 | 63 74 4e 61 6d 65 2c 20 |me(proje|ctName, |
|00001960| 74 6f 70 50 72 6f 6a 65 | 63 74 4e 61 6d 65 29 3b |topProje|ctName);|
|00001970| 0d 09 0d 09 2f 2a 20 6e | 6f 77 20 73 65 61 72 63 |..../* n|ow searc|
|00001980| 68 20 74 68 65 20 70 72 | 65 66 65 72 65 6e 63 65 |h the pr|eference|
|00001990| 73 20 66 6f 6c 64 65 72 | 20 2a 2f 0d 09 72 65 74 |s folder| */..ret|
|000019a0| 75 72 6e 20 46 69 6e 64 | 50 72 6f 6a 65 63 74 41 |urn Find|ProjectA|
|000019b0| 6c 69 61 73 46 72 6f 6d | 50 72 6f 6a 65 63 74 4e |liasFrom|ProjectN|
|000019c0| 61 6d 65 28 74 6f 70 50 | 72 6f 6a 65 63 74 4e 61 |ame(topP|rojectNa|
|000019d0| 6d 65 2c 20 72 65 61 6c | 50 72 6f 6a 65 63 74 4e |me, real|ProjectN|
|000019e0| 61 6d 65 2c 20 61 6c 69 | 61 73 4f 75 74 2c 20 66 |ame, ali|asOut, f|
|000019f0| 61 6c 73 65 29 3b 0d 7d | 0d 0d 0d 76 6f 69 64 20 |alse);.}|...void |
|00001a00| 44 65 6c 65 74 65 4d 61 | 70 70 69 6e 67 28 4e 61 |DeleteMa|pping(Na|
|00001a10| 6d 65 4d 61 70 70 69 6e | 67 20 2a 74 68 65 4d 61 |meMappin|g *theMa|
|00001a20| 70 70 69 6e 67 29 0d 7b | 0d 09 77 68 69 6c 65 20 |pping).{|..while |
|00001a30| 28 74 68 65 4d 61 70 70 | 69 6e 67 20 21 3d 20 4e |(theMapp|ing != N|
|00001a40| 55 4c 4c 29 0d 09 7b 0d | 09 09 4e 61 6d 65 4d 61 |ULL)..{.|..NameMa|
|00001a50| 70 70 69 6e 67 20 2a 61 | 4d 61 70 70 69 6e 67 20 |pping *a|Mapping |
|00001a60| 3d 20 74 68 65 4d 61 70 | 70 69 6e 67 2d 3e 66 4e |= theMap|ping->fN|
|00001a70| 65 78 74 3b 0d 09 09 69 | 66 20 28 74 68 65 4d 61 |ext;...i|f (theMa|
|00001a80| 70 70 69 6e 67 2d 3e 66 | 50 72 6f 6a 65 63 74 4e |pping->f|ProjectN|
|00001a90| 61 6d 65 20 21 3d 20 4e | 55 4c 4c 29 0d 09 09 09 |ame != N|ULL)....|
|00001aa0| 44 69 73 70 6f 73 65 50 | 74 72 28 28 50 74 72 29 |DisposeP|tr((Ptr)|
|00001ab0| 74 68 65 4d 61 70 70 69 | 6e 67 2d 3e 66 50 72 6f |theMappi|ng->fPro|
|00001ac0| 6a 65 63 74 4e 61 6d 65 | 29 3b 0d 09 09 69 66 20 |jectName|);...if |
|00001ad0| 28 74 68 65 4d 61 70 70 | 69 6e 67 2d 3e 66 46 6f |(theMapp|ing->fFo|
|00001ae0| 6c 64 65 72 4e 61 6d 65 | 20 21 3d 20 4e 55 4c 4c |lderName| != NULL|
|00001af0| 29 0d 09 09 09 44 69 73 | 70 6f 73 65 50 74 72 28 |)....Dis|posePtr(|
|00001b00| 28 50 74 72 29 74 68 65 | 4d 61 70 70 69 6e 67 2d |(Ptr)the|Mapping-|
|00001b10| 3e 66 46 6f 6c 64 65 72 | 4e 61 6d 65 29 3b 0d 09 |>fFolder|Name);..|
|00001b20| 09 74 68 65 4d 61 70 70 | 69 6e 67 20 3d 20 61 4d |.theMapp|ing = aM|
|00001b30| 61 70 70 69 6e 67 3b 0d | 09 09 44 69 73 70 6f 73 |apping;.|..Dispos|
|00001b40| 65 50 74 72 28 28 50 74 | 72 29 74 68 65 4d 61 70 |ePtr((Pt|r)theMap|
|00001b50| 70 69 6e 67 29 3b 0d 09 | 7d 0d 7d 0d 0d 0d 4f 53 |ping);..|}.}...OS|
|00001b60| 45 72 72 20 41 64 64 4e | 61 6d 65 4d 61 70 70 69 |Err AddN|ameMappi|
|00001b70| 6e 67 28 53 74 72 69 6e | 67 50 74 72 20 66 6f 6c |ng(Strin|gPtr fol|
|00001b80| 64 65 72 4e 61 6d 65 2c | 20 53 74 72 69 6e 67 50 |derName,| StringP|
|00001b90| 74 72 20 70 72 6f 6a 65 | 63 74 4e 61 6d 65 29 0d |tr proje|ctName).|
|00001ba0| 7b 0d 09 4f 53 45 72 72 | 20 65 72 72 3b 0d 09 46 |{..OSErr| err;..F|
|00001bb0| 53 53 70 65 63 20 66 69 | 6c 65 3b 0d 09 48 61 6e |SSpec fi|le;..Han|
|00001bc0| 64 6c 65 20 66 69 6c 65 | 44 61 74 61 20 3d 20 4e |dle file|Data = N|
|00001bd0| 55 4c 4c 3b 0d 09 73 68 | 6f 72 74 20 72 65 66 4e |ULL;..sh|ort refN|
|00001be0| 75 6d 20 3d 20 2d 31 3b | 0d 09 63 68 61 72 20 63 |um = -1;|..char c|
|00001bf0| 3b 0d 09 0d 09 2f 2a 20 | 66 69 6e 64 20 74 68 65 |;..../* |find the|
|00001c00| 20 70 72 65 66 65 72 65 | 6e 63 65 73 20 66 6f 6c | prefere|nces fol|
|00001c10| 64 65 72 20 2a 2f 0d 09 | 65 72 72 20 3d 20 46 69 |der */..|err = Fi|
|00001c20| 6e 64 50 72 65 66 65 72 | 65 6e 63 65 73 46 6f 6c |ndPrefer|encesFol|
|00001c30| 64 65 72 28 26 66 69 6c | 65 2e 76 52 65 66 4e 75 |der(&fil|e.vRefNu|
|00001c40| 6d 2c 20 26 66 69 6c 65 | 2e 70 61 72 49 44 29 3b |m, &file|.parID);|
|00001c50| 0d 09 69 66 20 28 65 72 | 72 20 21 3d 20 6e 6f 45 |..if (er|r != noE|
|00001c60| 72 72 29 20 67 6f 74 6f | 20 45 72 72 6f 72 45 78 |rr) goto| ErrorEx|
|00001c70| 69 74 3b 0d 09 0d 09 2f | 2a 20 67 65 74 20 74 68 |it;..../|* get th|
|00001c80| 65 20 46 6f 6c 64 65 72 | 20 4e 61 6d 65 73 20 66 |e Folder| Names f|
|00001c90| 69 6c 65 20 64 61 74 61 | 20 2a 2f 0d 09 47 65 74 |ile data| */..Get|
|00001ca0| 49 6e 64 53 74 72 69 6e | 67 28 66 69 6c 65 2e 6e |IndStrin|g(file.n|
|00001cb0| 61 6d 65 2c 20 6b 50 72 | 6f 6a 65 63 74 44 72 61 |ame, kPr|ojectDra|
|00001cc0| 67 53 74 72 69 6e 67 73 | 2c 20 6b 4e 61 6d 65 4d |gStrings|, kNameM|
|00001cd0| 61 70 70 69 6e 67 46 69 | 6c 65 29 3b 0d 09 65 72 |appingFi|le);..er|
|00001ce0| 72 20 3d 20 47 65 74 46 | 69 6c 65 44 61 74 61 28 |r = GetF|ileData(|
|00001cf0| 26 66 69 6c 65 2c 20 26 | 66 69 6c 65 44 61 74 61 |&file, &|fileData|
|00001d00| 2c 20 26 72 65 66 4e 75 | 6d 29 3b 0d 09 69 66 20 |, &refNu|m);..if |
|00001d10| 28 65 72 72 20 3d 3d 20 | 66 6e 66 45 72 72 29 0d |(err == |fnfErr).|
|00001d20| 09 7b 0d 09 09 2f 2a 20 | 63 72 65 61 74 65 20 61 |.{.../* |create a|
|00001d30| 6e 64 20 6f 70 65 6e 20 | 74 68 65 20 66 69 6c 65 |nd open |the file|
|00001d40| 20 2a 2f 0d 09 09 65 72 | 72 20 3d 20 46 53 70 43 | */...er|r = FSpC|
|00001d50| 72 65 61 74 65 28 26 66 | 69 6c 65 2c 20 27 4d 50 |reate(&f|ile, 'MP|
|00001d60| 53 20 27 2c 20 27 54 45 | 58 54 27 2c 20 73 6d 53 |S ', 'TE|XT', smS|
|00001d70| 79 73 74 65 6d 53 63 72 | 69 70 74 29 3b 0d 09 09 |ystemScr|ipt);...|
|00001d80| 69 66 20 28 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |if (err |!= noErr|
|00001d90| 29 20 67 6f 74 6f 20 45 | 72 72 6f 72 45 78 69 74 |) goto E|rrorExit|
|00001da0| 3b 0d 09 09 65 72 72 20 | 3d 20 46 53 70 4f 70 65 |;...err |= FSpOpe|
|00001db0| 6e 44 46 28 26 66 69 6c | 65 2c 20 66 73 52 64 57 |nDF(&fil|e, fsRdW|
|00001dc0| 72 50 65 72 6d 2c 20 26 | 72 65 66 4e 75 6d 29 3b |rPerm, &|refNum);|
|00001dd0| 0d 09 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |...if (e|rr != no|
|00001de0| 45 72 72 29 20 67 6f 74 | 6f 20 45 72 72 6f 72 45 |Err) got|o ErrorE|
|00001df0| 78 69 74 3b 0d 09 09 66 | 69 6c 65 44 61 74 61 20 |xit;...f|ileData |
|00001e00| 3d 20 54 65 6d 70 4e 65 | 77 48 61 6e 64 6c 65 28 |= TempNe|wHandle(|
|00001e10| 30 2c 20 26 65 72 72 29 | 3b 0d 09 7d 0d 09 69 66 |0, &err)|;..}..if|
|00001e20| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 20 | (err !=| noErr) |
|00001e30| 67 6f 74 6f 20 45 72 72 | 6f 72 45 78 69 74 3b 0d |goto Err|orExit;.|
|00001e40| 09 0d 09 2f 2a 20 61 64 | 64 20 61 20 6c 69 6e 65 |.../* ad|d a line|
|00001e50| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 74 68 65 20 | contain|ing the |
|00001e60| 6e 65 77 20 6d 61 70 70 | 69 6e 67 20 2d 2d 20 58 |new mapp|ing -- X|
|00001e70| 58 58 20 2d 2d 20 61 73 | 73 75 6d 65 73 20 45 4f |XX -- as|sumes EO|
|00001e80| 4c 20 61 74 20 45 4f 46 | 20 2a 2f 0d 09 65 72 72 |L at EOF| */..err|
|00001e90| 20 3d 20 50 74 72 41 6e | 64 48 61 6e 64 28 70 72 | = PtrAn|dHand(pr|
|00001ea0| 6f 6a 65 63 74 4e 61 6d | 65 20 2b 20 31 2c 20 66 |ojectNam|e + 1, f|
|00001eb0| 69 6c 65 44 61 74 61 2c | 20 70 72 6f 6a 65 63 74 |ileData,| project|
|00001ec0| 4e 61 6d 65 5b 30 5d 29 | 3b 0d 09 69 66 20 28 65 |Name[0])|;..if (e|
|00001ed0| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 20 67 6f 74 |rr != no|Err) got|
|00001ee0| 6f 20 45 72 72 6f 72 45 | 78 69 74 3b 0d 09 63 20 |o ErrorE|xit;..c |
|00001ef0| 3d 20 27 3d 27 3b 0d 09 | 65 72 72 20 3d 20 50 74 |= '=';..|err = Pt|
|00001f00| 72 41 6e 64 48 61 6e 64 | 28 26 63 2c 20 66 69 6c |rAndHand|(&c, fil|
|00001f10| 65 44 61 74 61 2c 20 31 | 29 3b 0d 09 69 66 20 28 |eData, 1|);..if (|
|00001f20| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 67 6f |err != n|oErr) go|
|00001f30| 74 6f 20 45 72 72 6f 72 | 45 78 69 74 3b 0d 09 65 |to Error|Exit;..e|
|00001f40| 72 72 20 3d 20 50 74 72 | 41 6e 64 48 61 6e 64 28 |rr = Ptr|AndHand(|
|00001f50| 66 6f 6c 64 65 72 4e 61 | 6d 65 20 2b 20 31 2c 20 |folderNa|me + 1, |
|00001f60| 66 69 6c 65 44 61 74 61 | 2c 20 66 6f 6c 64 65 72 |fileData|, folder|
|00001f70| 4e 61 6d 65 5b 30 5d 29 | 3b 0d 09 69 66 20 28 65 |Name[0])|;..if (e|
|00001f80| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 20 67 6f 74 |rr != no|Err) got|
|00001f90| 6f 20 45 72 72 6f 72 45 | 78 69 74 3b 0d 09 63 20 |o ErrorE|xit;..c |
|00001fa0| 3d 20 27 5c 6e 27 3b 0d | 09 65 72 72 20 3d 20 50 |= '\n';.|.err = P|
|00001fb0| 74 72 41 6e 64 48 61 6e | 64 28 26 63 2c 20 66 69 |trAndHan|d(&c, fi|
|00001fc0| 6c 65 44 61 74 61 2c 20 | 31 29 3b 0d 09 69 66 20 |leData, |1);..if |
|00001fd0| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 67 |(err != |noErr) g|
|00001fe0| 6f 74 6f 20 45 72 72 6f | 72 45 78 69 74 3b 0d 09 |oto Erro|rExit;..|
|00001ff0| 65 72 72 20 3d 20 57 72 | 69 74 65 46 69 6c 65 57 |err = Wr|iteFileW|
|00002000| 69 74 68 48 65 61 64 65 | 72 28 72 65 66 4e 75 6d |ithHeade|r(refNum|
|00002010| 2c 20 66 69 6c 65 44 61 | 74 61 2c 20 30 2c 20 4e |, fileDa|ta, 0, N|
|00002020| 55 4c 4c 29 3b 0d 09 69 | 66 20 28 65 72 72 20 21 |ULL);..i|f (err !|
|00002030| 3d 20 6e 6f 45 72 72 29 | 20 67 6f 74 6f 20 45 72 |= noErr)| goto Er|
|00002040| 72 6f 72 45 78 69 74 3b | 0d 09 0d 09 2f 2a 20 63 |rorExit;|..../* c|
|00002050| 6c 65 61 6e 20 75 70 20 | 61 6e 64 20 67 6f 20 2a |lean up |and go *|
|00002060| 2f 0d 09 44 69 73 70 6f | 73 65 48 61 6e 64 6c 65 |/..Dispo|seHandle|
|00002070| 28 66 69 6c 65 44 61 74 | 61 29 3b 0d 09 46 53 43 |(fileDat|a);..FSC|
|00002080| 6c 6f 73 65 28 72 65 66 | 4e 75 6d 29 3b 0d 09 72 |lose(ref|Num);..r|
|00002090| 65 74 75 72 6e 20 6e 6f | 45 72 72 3b 0d 0d 45 72 |eturn no|Err;..Er|
|000020a0| 72 6f 72 45 78 69 74 3a | 0d 09 69 66 20 28 66 69 |rorExit:|..if (fi|
|000020b0| 6c 65 44 61 74 61 20 21 | 3d 20 4e 55 4c 4c 29 0d |leData !|= NULL).|
|000020c0| 09 09 44 69 73 70 6f 73 | 65 48 61 6e 64 6c 65 28 |..Dispos|eHandle(|
|000020d0| 66 69 6c 65 44 61 74 61 | 29 3b 0d 09 69 66 20 28 |fileData|);..if (|
|000020e0| 72 65 66 4e 75 6d 20 21 | 3d 20 2d 31 29 0d 09 09 |refNum !|= -1)...|
|000020f0| 46 53 43 6c 6f 73 65 28 | 72 65 66 4e 75 6d 29 3b |FSClose(|refNum);|
|00002100| 0d 09 72 65 74 75 72 6e | 20 65 72 72 3b 0d 7d 0d |..return| err;.}.|
|00002110| 0d 2f 2a 20 53 6f 6d 65 | 20 69 6e 64 69 76 69 64 |./* Some| individ|
|00002120| 75 61 6c 73 20 68 61 76 | 65 20 64 65 63 69 64 65 |uals hav|e decide|
|00002130| 64 20 74 6f 20 6e 61 6d | 65 20 74 68 65 69 72 20 |d to nam|e their |
|00002140| 63 68 65 63 6b 6f 75 74 | 20 66 6f 6c 64 65 72 20 |checkout| folder |
|00002150| 73 6f 6d 65 74 68 69 6e | 67 20 64 69 66 66 65 72 |somethin|g differ|
|00002160| 65 6e 74 0d 20 2a 20 66 | 72 6f 6d 20 74 68 65 69 |ent. * f|rom thei|
|00002170| 72 20 70 72 6f 6a 65 63 | 74 20 6e 61 6d 65 2e 20 |r projec|t name. |
|00002180| 46 6f 72 20 74 68 69 73 | 20 72 65 61 73 6f 6e 20 |For this| reason |
|00002190| 77 65 20 6b 65 65 70 20 | 61 20 66 69 6c 65 20 63 |we keep |a file c|
|000021a0| 61 6c 6c 65 64 20 22 46 | 6f 6c 64 65 72 20 4e 61 |alled "F|older Na|
|000021b0| 6d 65 73 22 2e 0d 20 2a | 20 54 68 69 73 20 69 73 |mes".. *| This is|
|000021c0| 20 61 20 74 65 78 74 20 | 66 69 6c 65 20 77 69 74 | a text |file wit|
|000021d0| 68 20 6c 69 6e 65 73 20 | 6f 66 20 74 68 65 20 66 |h lines |of the f|
|000021e0| 6f 72 6d 20 28 65 2e 67 | 2e 29 20 22 49 6e 66 6f |orm (e.g|.) "Info|
|000021f0| 41 63 63 65 73 73 50 72 | 6f 6a 3d 49 6e 66 6f 41 |AccessPr|oj=InfoA|
|00002200| 63 63 65 73 73 22 2c 0d | 20 2a 20 77 68 65 72 65 |ccess",.| * where|
|00002210| 20 74 68 65 20 70 72 6f | 6a 65 63 74 20 6e 61 6d | the pro|ject nam|
|00002220| 65 20 69 73 20 66 69 72 | 73 74 20 61 6e 64 20 74 |e is fir|st and t|
|00002230| 68 65 20 66 6f 6c 64 65 | 72 20 6e 61 6d 65 20 73 |he folde|r name s|
|00002240| 65 63 6f 6e 64 2e 0d 20 | 2a 2f 0d 0d 4e 61 6d 65 |econd.. |*/..Name|
|00002250| 4d 61 70 70 69 6e 67 20 | 2a 47 65 74 4e 61 6d 65 |Mapping |*GetName|
|00002260| 4d 61 70 70 69 6e 67 28 | 76 6f 69 64 29 0d 7b 0d |Mapping(|void).{.|
|00002270| 09 4f 53 45 72 72 20 65 | 72 72 3b 0d 09 46 53 53 |.OSErr e|rr;..FSS|
|00002280| 70 65 63 20 66 69 6c 65 | 3b 0d 09 48 61 6e 64 6c |pec file|;..Handl|
|00002290| 65 20 66 69 6c 65 44 61 | 74 61 3b 0d 09 73 68 6f |e fileDa|ta;..sho|
|000022a0| 72 74 20 72 65 66 4e 75 | 6d 3b 0d 09 53 74 72 69 |rt refNu|m;..Stri|
|000022b0| 6e 67 50 74 72 20 66 69 | 6c 65 4c 69 6e 65 3b 0d |ngPtr fi|leLine;.|
|000022c0| 09 6c 6f 6e 67 20 66 69 | 6c 65 4c 65 6e 67 74 68 |.long fi|leLength|
|000022d0| 3b 0d 09 6c 6f 6e 67 20 | 66 69 6c 65 4c 69 6e 65 |;..long |fileLine|
|000022e0| 4c 65 6e 67 74 68 3b 0d | 09 4e 61 6d 65 4d 61 70 |Length;.|.NameMap|
|000022f0| 70 69 6e 67 20 2a 74 68 | 65 4d 61 70 70 69 6e 67 |ping *th|eMapping|
|00002300| 20 3d 20 4e 55 4c 4c 3b | 0d 09 0d 09 2f 2a 20 66 | = NULL;|..../* f|
|00002310| 69 6e 64 20 74 68 65 20 | 70 72 65 66 65 72 65 6e |ind the |preferen|
|00002320| 63 65 73 20 66 6f 6c 64 | 65 72 20 2a 2f 0d 09 65 |ces fold|er */..e|
|00002330| 72 72 20 3d 20 46 69 6e | 64 50 72 65 66 65 72 65 |rr = Fin|dPrefere|
|00002340| 6e 63 65 73 46 6f 6c 64 | 65 72 28 26 66 69 6c 65 |ncesFold|er(&file|
|00002350| 2e 76 52 65 66 4e 75 6d | 2c 20 26 66 69 6c 65 2e |.vRefNum|, &file.|
|00002360| 70 61 72 49 44 29 3b 0d | 09 69 66 20 28 65 72 72 |parID);.|.if (err|
|00002370| 20 21 3d 20 6e 6f 45 72 | 72 29 20 72 65 74 75 72 | != noEr|r) retur|
|00002380| 6e 20 4e 55 4c 4c 3b 0d | 09 0d 09 2f 2a 20 67 65 |n NULL;.|.../* ge|
|00002390| 74 20 74 68 65 20 46 6f | 6c 64 65 72 20 4e 61 6d |t the Fo|lder Nam|
|000023a0| 65 73 20 66 69 6c 65 20 | 64 61 74 61 20 2a 2f 0d |es file |data */.|
|000023b0| 09 47 65 74 49 6e 64 53 | 74 72 69 6e 67 28 66 69 |.GetIndS|tring(fi|
|000023c0| 6c 65 2e 6e 61 6d 65 2c | 20 6b 50 72 6f 6a 65 63 |le.name,| kProjec|
|000023d0| 74 44 72 61 67 53 74 72 | 69 6e 67 73 2c 20 6b 4e |tDragStr|ings, kN|
|000023e0| 61 6d 65 4d 61 70 70 69 | 6e 67 46 69 6c 65 29 3b |ameMappi|ngFile);|
|000023f0| 0d 09 65 72 72 20 3d 20 | 47 65 74 46 69 6c 65 44 |..err = |GetFileD|
|00002400| 61 74 61 28 26 66 69 6c | 65 2c 20 26 66 69 6c 65 |ata(&fil|e, &file|
|00002410| 44 61 74 61 2c 20 26 72 | 65 66 4e 75 6d 29 3b 0d |Data, &r|efNum);.|
|00002420| 09 69 66 20 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |.if (err| != noEr|
|00002430| 72 29 20 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0d |r) retur|n NULL;.|
|00002440| 09 46 53 43 6c 6f 73 65 | 28 72 65 66 4e 75 6d 29 |.FSClose|(refNum)|
|00002450| 3b 0d 09 0d 09 2f 2a 20 | 70 61 72 73 65 20 74 68 |;..../* |parse th|
|00002460| 65 20 73 74 72 69 6e 67 | 73 20 2a 2f 0d 09 48 4c |e string|s */..HL|
|00002470| 6f 63 6b 28 66 69 6c 65 | 44 61 74 61 29 3b 0d 09 |ock(file|Data);..|
|00002480| 66 69 6c 65 4c 65 6e 67 | 74 68 20 3d 20 47 65 74 |fileLeng|th = Get|
|00002490| 48 61 6e 64 6c 65 53 69 | 7a 65 28 66 69 6c 65 44 |HandleSi|ze(fileD|
|000024a0| 61 74 61 29 3b 0d 09 66 | 69 6c 65 4c 69 6e 65 20 |ata);..f|ileLine |
|000024b0| 3d 20 2a 66 69 6c 65 44 | 61 74 61 3b 0d 09 66 69 |= *fileD|ata;..fi|
|000024c0| 6c 65 4c 69 6e 65 4c 65 | 6e 67 74 68 20 3d 20 4c |leLineLe|ngth = L|
|000024d0| 69 6e 65 53 69 7a 65 28 | 66 69 6c 65 4c 69 6e 65 |ineSize(|fileLine|
|000024e0| 2c 20 66 69 6c 65 4c 65 | 6e 67 74 68 29 3b 0d 09 |, fileLe|ngth);..|
|000024f0| 64 6f 0d 09 7b 0d 09 09 | 73 68 6f 72 74 20 65 71 |do..{...|short eq|
|00002500| 75 61 6c 53 69 67 6e 3b | 0d 09 09 73 68 6f 72 74 |ualSign;|...short|
|00002510| 20 70 61 72 74 4c 65 6e | 67 74 68 3b 0d 09 09 0d | partLen|gth;....|
|00002520| 09 09 2f 2a 20 66 69 6e | 64 20 74 68 65 20 65 71 |../* fin|d the eq|
|00002530| 75 61 6c 20 73 69 67 6e | 20 2a 2f 0d 09 09 66 6f |ual sign| */...fo|
|00002540| 72 20 28 65 71 75 61 6c | 53 69 67 6e 20 3d 20 30 |r (equal|Sign = 0|
|00002550| 3b 0d 09 09 09 20 65 71 | 75 61 6c 53 69 67 6e 20 |;.... eq|ualSign |
|00002560| 3c 20 66 69 6c 65 4c 69 | 6e 65 4c 65 6e 67 74 68 |< fileLi|neLength|
|00002570| 20 26 26 20 66 69 6c 65 | 4c 69 6e 65 5b 65 71 75 | && file|Line[equ|
|00002580| 61 6c 53 69 67 6e 5d 20 | 21 3d 20 27 3d 27 3b 0d |alSign] |!= '=';.|
|00002590| 09 09 09 20 65 71 75 61 | 6c 53 69 67 6e 2b 2b 29 |... equa|lSign++)|
|000025a0| 0d 09 09 09 09 3b 0d 09 | 09 69 66 20 28 65 71 75 |.....;..|.if (equ|
|000025b0| 61 6c 53 69 67 6e 20 3c | 20 66 69 6c 65 4c 69 6e |alSign <| fileLin|
|000025c0| 65 4c 65 6e 67 74 68 29 | 0d 09 09 7b 0d 09 09 09 |eLength)|...{....|
|000025d0| 2f 2a 20 61 6c 6c 6f 63 | 61 74 65 20 74 68 65 20 |/* alloc|ate the |
|000025e0| 6d 61 70 70 69 6e 67 20 | 73 74 72 75 63 74 20 2a |mapping |struct *|
|000025f0| 2f 0d 09 09 09 4e 61 6d | 65 4d 61 70 70 69 6e 67 |/....Nam|eMapping|
|00002600| 20 2a 61 4d 61 70 70 69 | 6e 67 20 3d 20 28 4e 61 | *aMappi|ng = (Na|
|00002610| 6d 65 4d 61 70 70 69 6e | 67 2a 29 4e 65 77 50 74 |meMappin|g*)NewPt|
|00002620| 72 43 6c 65 61 72 28 73 | 69 7a 65 6f 66 28 4e 61 |rClear(s|izeof(Na|
|00002630| 6d 65 4d 61 70 70 69 6e | 67 29 29 3b 0d 09 09 09 |meMappin|g));....|
|00002640| 69 66 20 28 61 4d 61 70 | 70 69 6e 67 20 3d 3d 20 |if (aMap|ping == |
|00002650| 4e 55 4c 4c 29 0d 09 09 | 09 7b 0d 09 09 09 09 44 |NULL)...|.{.....D|
|00002660| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 66 69 6c |isposeHa|ndle(fil|
|00002670| 65 44 61 74 61 29 3b 0d | 09 09 09 09 44 65 6c 65 |eData);.|....Dele|
|00002680| 74 65 4d 61 70 70 69 6e | 67 28 74 68 65 4d 61 70 |teMappin|g(theMap|
|00002690| 70 69 6e 67 29 3b 0d 09 | 09 09 09 72 65 74 75 72 |ping);..|...retur|
|000026a0| 6e 20 4e 55 4c 4c 3b 0d | 09 09 09 7d 0d 09 09 09 |n NULL;.|...}....|
|000026b0| 0d 09 09 09 2f 2a 20 65 | 78 74 72 61 63 74 20 74 |..../* e|xtract t|
|000026c0| 68 65 20 6c 69 6e 65 20 | 75 70 20 74 6f 20 74 68 |he line |up to th|
|000026d0| 65 20 65 71 75 61 6c 20 | 73 69 67 6e 20 2a 2f 0d |e equal |sign */.|
|000026e0| 09 09 09 70 61 72 74 4c | 65 6e 67 74 68 20 3d 20 |...partL|ength = |
|000026f0| 65 71 75 61 6c 53 69 67 | 6e 3b 0d 09 09 09 61 4d |equalSig|n;....aM|
|00002700| 61 70 70 69 6e 67 2d 3e | 66 50 72 6f 6a 65 63 74 |apping->|fProject|
|00002710| 4e 61 6d 65 20 3d 20 4e | 65 77 50 74 72 28 70 61 |Name = N|ewPtr(pa|
|00002720| 72 74 4c 65 6e 67 74 68 | 20 2b 20 31 29 3b 0d 09 |rtLength| + 1);..|
|00002730| 09 09 69 66 20 28 61 4d | 61 70 70 69 6e 67 2d 3e |..if (aM|apping->|
|00002740| 66 50 72 6f 6a 65 63 74 | 4e 61 6d 65 20 3d 3d 20 |fProject|Name == |
|00002750| 4e 55 4c 4c 29 0d 09 09 | 09 7b 0d 09 09 09 09 44 |NULL)...|.{.....D|
|00002760| 69 73 70 6f 73 65 50 74 | 72 28 28 50 74 72 29 61 |isposePt|r((Ptr)a|
|00002770| 4d 61 70 70 69 6e 67 29 | 3b 0d 09 09 09 09 44 69 |Mapping)|;.....Di|
|00002780| 73 70 6f 73 65 48 61 6e | 64 6c 65 28 66 69 6c 65 |sposeHan|dle(file|
|00002790| 44 61 74 61 29 3b 0d 09 | 09 09 09 44 65 6c 65 74 |Data);..|...Delet|
|000027a0| 65 4d 61 70 70 69 6e 67 | 28 74 68 65 4d 61 70 70 |eMapping|(theMapp|
|000027b0| 69 6e 67 29 3b 0d 09 09 | 09 09 72 65 74 75 72 6e |ing);...|..return|
|000027c0| 20 4e 55 4c 4c 3b 0d 09 | 09 09 7d 0d 09 09 09 42 | NULL;..|..}....B|
|000027d0| 6c 6f 63 6b 4d 6f 76 65 | 44 61 74 61 28 66 69 6c |lockMove|Data(fil|
|000027e0| 65 4c 69 6e 65 2c 20 61 | 4d 61 70 70 69 6e 67 2d |eLine, a|Mapping-|
|000027f0| 3e 66 50 72 6f 6a 65 63 | 74 4e 61 6d 65 20 2b 20 |>fProjec|tName + |
|00002800| 31 2c 20 70 61 72 74 4c | 65 6e 67 74 68 29 3b 0d |1, partL|ength);.|
|00002810| 09 09 09 61 4d 61 70 70 | 69 6e 67 2d 3e 66 50 72 |...aMapp|ing->fPr|
|00002820| 6f 6a 65 63 74 4e 61 6d | 65 5b 30 5d 20 3d 20 70 |ojectNam|e[0] = p|
|00002830| 61 72 74 4c 65 6e 67 74 | 68 3b 0d 09 09 09 0d 09 |artLengt|h;......|
|00002840| 09 09 2f 2a 20 65 78 74 | 72 61 63 74 20 74 68 65 |../* ext|ract the|
|00002850| 20 6c 69 6e 65 20 61 66 | 74 65 72 20 74 68 65 20 | line af|ter the |
|00002860| 65 71 75 61 6c 20 73 69 | 67 6e 20 2d 2d 20 58 58 |equal si|gn -- XX|
|00002870| 58 20 2d 2d 20 61 73 73 | 75 6d 65 73 20 45 4f 4c |X -- ass|umes EOL|
|00002880| 20 61 74 20 45 4f 46 2e | 2e 2e 2e 20 2a 2f 0d 09 | at EOF.|... */..|
|00002890| 09 09 70 61 72 74 4c 65 | 6e 67 74 68 20 3d 20 28 |..partLe|ngth = (|
|000028a0| 66 69 6c 65 4c 69 6e 65 | 4c 65 6e 67 74 68 20 2d |fileLine|Length -|
|000028b0| 20 65 71 75 61 6c 53 69 | 67 6e 29 20 2d 20 32 3b | equalSi|gn) - 2;|
|000028c0| 0d 09 09 09 61 4d 61 70 | 70 69 6e 67 2d 3e 66 46 |....aMap|ping->fF|
|000028d0| 6f 6c 64 65 72 4e 61 6d | 65 20 3d 20 4e 65 77 50 |olderNam|e = NewP|
|000028e0| 74 72 28 70 61 72 74 4c | 65 6e 67 74 68 29 3b 0d |tr(partL|ength);.|
|000028f0| 09 09 09 69 66 20 28 61 | 4d 61 70 70 69 6e 67 2d |...if (a|Mapping-|
|00002900| 3e 66 46 6f 6c 64 65 72 | 4e 61 6d 65 20 3d 3d 20 |>fFolder|Name == |
|00002910| 4e 55 4c 4c 29 0d 09 09 | 09 7b 0d 09 09 09 09 44 |NULL)...|.{.....D|
|00002920| 69 73 70 6f 73 65 50 74 | 72 28 28 50 74 72 29 61 |isposePt|r((Ptr)a|
|00002930| 4d 61 70 70 69 6e 67 2d | 3e 66 50 72 6f 6a 65 63 |Mapping-|>fProjec|
|00002940| 74 4e 61 6d 65 29 3b 0d | 09 09 09 09 44 69 73 70 |tName);.|....Disp|
|00002950| 6f 73 65 50 74 72 28 28 | 50 74 72 29 61 4d 61 70 |osePtr((|Ptr)aMap|
|00002960| 70 69 6e 67 29 3b 0d 09 | 09 09 09 44 69 73 70 6f |ping);..|...Dispo|
|00002970| 73 65 48 61 6e 64 6c 65 | 28 66 69 6c 65 44 61 74 |seHandle|(fileDat|
|00002980| 61 29 3b 0d 09 09 09 09 | 44 65 6c 65 74 65 4d 61 |a);.....|DeleteMa|
|00002990| 70 70 69 6e 67 28 74 68 | 65 4d 61 70 70 69 6e 67 |pping(th|eMapping|
|000029a0| 29 3b 0d 09 09 09 09 72 | 65 74 75 72 6e 20 4e 55 |);.....r|eturn NU|
|000029b0| 4c 4c 3b 0d 09 09 09 7d | 0d 09 09 09 42 6c 6f 63 |LL;....}|....Bloc|
|000029c0| 6b 4d 6f 76 65 44 61 74 | 61 28 66 69 6c 65 4c 69 |kMoveDat|a(fileLi|
|000029d0| 6e 65 20 2b 20 65 71 75 | 61 6c 53 69 67 6e 20 2b |ne + equ|alSign +|
|000029e0| 20 31 2c 20 61 4d 61 70 | 70 69 6e 67 2d 3e 66 46 | 1, aMap|ping->fF|
|000029f0| 6f 6c 64 65 72 4e 61 6d | 65 20 2b 20 31 2c 20 70 |olderNam|e + 1, p|
|00002a00| 61 72 74 4c 65 6e 67 74 | 68 29 3b 0d 09 09 09 61 |artLengt|h);....a|
|00002a10| 4d 61 70 70 69 6e 67 2d | 3e 66 46 6f 6c 64 65 72 |Mapping-|>fFolder|
|00002a20| 4e 61 6d 65 5b 30 5d 20 | 3d 20 70 61 72 74 4c 65 |Name[0] |= partLe|
|00002a30| 6e 67 74 68 3b 0d 09 09 | 09 0d 09 09 09 2f 2a 20 |ngth;...|...../* |
|00002a40| 6c 69 6e 6b 20 74 68 69 | 73 20 6d 61 70 70 69 6e |link thi|s mappin|
|00002a50| 67 20 69 6e 74 6f 20 74 | 68 65 20 6c 69 73 74 20 |g into t|he list |
|00002a60| 2a 2f 0d 09 09 09 61 4d | 61 70 70 69 6e 67 2d 3e |*/....aM|apping->|
|00002a70| 66 4e 65 78 74 20 3d 20 | 74 68 65 4d 61 70 70 69 |fNext = |theMappi|
|00002a80| 6e 67 3b 0d 09 09 09 74 | 68 65 4d 61 70 70 69 6e |ng;....t|heMappin|
|00002a90| 67 20 3d 20 61 4d 61 70 | 70 69 6e 67 3b 0d 09 09 |g = aMap|ping;...|
|00002aa0| 7d 0d 09 09 0d 09 09 2f | 2a 20 6e 65 78 74 20 6c |}....../|* next l|
|00002ab0| 69 6e 65 20 2a 2f 0d 09 | 09 66 69 6c 65 4c 69 6e |ine */..|.fileLin|
|00002ac0| 65 20 2b 3d 20 66 69 6c | 65 4c 69 6e 65 4c 65 6e |e += fil|eLineLen|
|00002ad0| 67 74 68 3b 0d 09 09 66 | 69 6c 65 4c 65 6e 67 74 |gth;...f|ileLengt|
|00002ae0| 68 20 2d 3d 20 66 69 6c | 65 4c 69 6e 65 4c 65 6e |h -= fil|eLineLen|
|00002af0| 67 74 68 3b 0d 09 09 66 | 69 6c 65 4c 69 6e 65 4c |gth;...f|ileLineL|
|00002b00| 65 6e 67 74 68 20 3d 20 | 4c 69 6e 65 53 69 7a 65 |ength = |LineSize|
|00002b10| 28 66 69 6c 65 4c 69 6e | 65 2c 20 66 69 6c 65 4c |(fileLin|e, fileL|
|00002b20| 65 6e 67 74 68 29 3b 0d | 09 7d 20 77 68 69 6c 65 |ength);.|.} while|
|00002b30| 20 28 66 69 6c 65 4c 65 | 6e 67 74 68 20 3e 20 30 | (fileLe|ngth > 0|
|00002b40| 29 3b 0d 09 0d 09 44 69 | 73 70 6f 73 65 48 61 6e |);....Di|sposeHan|
|00002b50| 64 6c 65 28 66 69 6c 65 | 44 61 74 61 29 3b 0d 09 |dle(file|Data);..|
|00002b60| 72 65 74 75 72 6e 20 74 | 68 65 4d 61 70 70 69 6e |return t|heMappin|
|00002b70| 67 3b 0d 7d 0d 0d 0d 2f | 2a 20 46 69 6e 64 20 74 |g;.}.../|* Find t|
|00002b80| 68 65 20 61 6c 69 61 73 | 20 74 6f 20 74 68 65 20 |he alias| to the |
|00002b90| 50 72 6f 6a 65 63 74 6f | 72 44 42 20 62 61 73 65 |Projecto|rDB base|
|00002ba0| 64 20 6f 6e 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |d on the| name of|
|00002bb0| 20 74 68 65 20 70 72 6f | 6a 65 63 74 2e 20 2a 2f | the pro|ject. */|
|00002bc0| 0d 0d 4f 53 45 72 72 20 | 46 69 6e 64 50 72 6f 6a |..OSErr |FindProj|
|00002bd0| 65 63 74 41 6c 69 61 73 | 46 72 6f 6d 50 72 6f 6a |ectAlias|FromProj|
|00002be0| 65 63 74 4e 61 6d 65 28 | 53 74 72 69 6e 67 50 74 |ectName(|StringPt|
|00002bf0| 72 20 74 6f 70 50 72 6f | 6a 65 63 74 4e 61 6d 65 |r topPro|jectName|
|00002c00| 2c 20 53 74 72 69 6e 67 | 50 74 72 20 72 65 61 6c |, String|Ptr real|
|00002c10| 50 72 6f 6a 65 63 74 4e | 61 6d 65 2c 0d 09 09 09 |ProjectN|ame,....|
|00002c20| 09 09 09 09 09 09 09 41 | 6c 69 61 73 48 61 6e 64 |.......A|liasHand|
|00002c30| 6c 65 20 2a 61 6c 69 61 | 73 4f 75 74 2c 20 42 6f |le *alia|sOut, Bo|
|00002c40| 6f 6c 65 61 6e 20 69 73 | 46 6f 6c 64 65 72 4e 61 |olean is|FolderNa|
|00002c50| 6d 65 29 0d 7b 0d 09 43 | 49 6e 66 6f 50 42 52 65 |me).{..C|InfoPBRe|
|00002c60| 63 20 70 62 3b 0d 09 4f | 53 45 72 72 20 65 72 72 |c pb;..O|SErr err|
|00002c70| 20 3d 20 6e 6f 45 72 72 | 3b 0d 09 73 68 6f 72 74 | = noErr|;..short|
|00002c80| 20 76 52 65 66 4e 75 6d | 3b 0d 09 6c 6f 6e 67 20 | vRefNum|;..long |
|00002c90| 66 6f 6c 64 65 72 49 44 | 3b 0d 09 0d 09 2f 2a 20 |folderID|;..../* |
|00002ca0| 64 65 66 61 75 6c 74 20 | 72 65 61 6c 20 6e 61 6d |default |real nam|
|00002cb0| 65 20 69 73 20 74 68 65 | 20 6e 61 6d 65 20 70 61 |e is the| name pa|
|00002cc0| 73 73 65 64 20 69 6e 20 | 2a 2f 0d 09 42 6c 6f 63 |ssed in |*/..Bloc|
|00002cd0| 6b 4d 6f 76 65 44 61 74 | 61 28 74 6f 70 50 72 6f |kMoveDat|a(topPro|
|00002ce0| 6a 65 63 74 4e 61 6d 65 | 2c 20 72 65 61 6c 50 72 |jectName|, realPr|
|00002cf0| 6f 6a 65 63 74 4e 61 6d | 65 2c 20 74 6f 70 50 72 |ojectNam|e, topPr|
|00002d00| 6f 6a 65 63 74 4e 61 6d | 65 5b 30 5d 20 2b 20 31 |ojectNam|e[0] + 1|
|00002d10| 29 3b 0d 09 0d 09 2f 2a | 20 63 68 65 63 6b 20 66 |);..../*| check f|
|00002d20| 6f 72 20 66 6f 6c 64 65 | 72 20 6e 61 6d 65 20 6d |or folde|r name m|
|00002d30| 61 70 70 69 6e 67 20 2a | 2f 0d 09 69 66 20 28 69 |apping *|/..if (i|
|00002d40| 73 46 6f 6c 64 65 72 4e | 61 6d 65 29 0d 09 7b 0d |sFolderN|ame)..{.|
|00002d50| 09 09 4e 61 6d 65 4d 61 | 70 70 69 6e 67 20 2a 74 |..NameMa|pping *t|
|00002d60| 68 65 4d 61 70 70 69 6e | 67 20 3d 20 47 65 74 4e |heMappin|g = GetN|
|00002d70| 61 6d 65 4d 61 70 70 69 | 6e 67 28 29 3b 0d 09 09 |ameMappi|ng();...|
|00002d80| 69 66 20 28 74 68 65 4d | 61 70 70 69 6e 67 20 21 |if (theM|apping !|
|00002d90| 3d 20 4e 55 4c 4c 29 0d | 09 09 7b 0d 09 09 09 4e |= NULL).|..{....N|
|00002da0| 61 6d 65 4d 61 70 70 69 | 6e 67 20 2a 61 4d 61 70 |ameMappi|ng *aMap|
|00002db0| 70 69 6e 67 3b 0d 09 09 | 09 66 6f 72 20 28 61 4d |ping;...|.for (aM|
|00002dc0| 61 70 70 69 6e 67 20 3d | 20 74 68 65 4d 61 70 70 |apping =| theMapp|
|00002dd0| 69 6e 67 3b 20 61 4d 61 | 70 70 69 6e 67 20 21 3d |ing; aMa|pping !=|
|00002de0| 20 4e 55 4c 4c 3b 20 61 | 4d 61 70 70 69 6e 67 20 | NULL; a|Mapping |
|00002df0| 3d 20 61 4d 61 70 70 69 | 6e 67 2d 3e 66 4e 65 78 |= aMappi|ng->fNex|
|00002e00| 74 29 0d 09 09 09 7b 0d | 09 09 09 09 69 66 20 28 |t)....{.|....if (|
|00002e10| 45 71 75 61 6c 53 74 72 | 69 6e 67 28 74 6f 70 50 |EqualStr|ing(topP|
|00002e20| 72 6f 6a 65 63 74 4e 61 | 6d 65 2c 20 61 4d 61 70 |rojectNa|me, aMap|
|00002e30| 70 69 6e 67 2d 3e 66 46 | 6f 6c 64 65 72 4e 61 6d |ping->fF|olderNam|
|00002e40| 65 2c 20 66 61 6c 73 65 | 2c 20 66 61 6c 73 65 29 |e, false|, false)|
|00002e50| 29 0d 09 09 09 09 7b 0d | 09 09 09 09 09 42 6c 6f |).....{.|.....Blo|
|00002e60| 63 6b 4d 6f 76 65 44 61 | 74 61 28 61 4d 61 70 70 |ckMoveDa|ta(aMapp|
|00002e70| 69 6e 67 2d 3e 66 50 72 | 6f 6a 65 63 74 4e 61 6d |ing->fPr|ojectNam|
|00002e80| 65 2c 20 72 65 61 6c 50 | 72 6f 6a 65 63 74 4e 61 |e, realP|rojectNa|
|00002e90| 6d 65 2c 20 61 4d 61 70 | 70 69 6e 67 2d 3e 66 50 |me, aMap|ping->fP|
|00002ea0| 72 6f 6a 65 63 74 4e 61 | 6d 65 5b 30 5d 20 2b 20 |rojectNa|me[0] + |
|00002eb0| 31 29 3b 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |1);.....|.break;.|
|00002ec0| 09 09 09 09 7d 0d 09 09 | 09 7d 0d 09 09 09 44 65 |....}...|.}....De|
|00002ed0| 6c 65 74 65 4d 61 70 70 | 69 6e 67 28 74 68 65 4d |leteMapp|ing(theM|
|00002ee0| 61 70 70 69 6e 67 29 3b | 0d 09 09 7d 0d 09 7d 0d |apping);|...}..}.|
|00002ef0| 09 0d 09 2f 2a 20 66 69 | 6e 64 20 74 68 65 20 70 |.../* fi|nd the p|
|00002f00| 72 65 66 65 72 65 6e 63 | 65 73 20 66 6f 6c 64 65 |referenc|es folde|
|00002f10| 72 20 2a 2f 0d 09 65 72 | 72 20 3d 20 46 69 6e 64 |r */..er|r = Find|
|00002f20| 50 72 65 66 65 72 65 6e | 63 65 73 46 6f 6c 64 65 |Preferen|cesFolde|
|00002f30| 72 28 26 76 52 65 66 4e | 75 6d 2c 20 26 66 6f 6c |r(&vRefN|um, &fol|
|00002f40| 64 65 72 49 44 29 3b 0d | 09 69 66 20 28 65 72 72 |derID);.|.if (err|
|00002f50| 20 21 3d 20 6e 6f 45 72 | 72 29 20 72 65 74 75 72 | != noEr|r) retur|
|00002f60| 6e 20 65 72 72 3b 0d 0d | 09 2f 2a 20 6c 6f 6f 70 |n err;..|./* loop|
|00002f70| 20 6f 76 65 72 20 74 68 | 65 20 61 6c 69 61 73 65 | over th|e aliase|
|00002f80| 73 20 69 6e 20 74 68 65 | 20 70 72 65 66 65 72 65 |s in the| prefere|
|00002f90| 6e 63 65 73 20 66 6f 6c | 64 65 72 20 2a 2f 0d 09 |nces fol|der */..|
|00002fa0| 66 6f 72 20 28 70 62 2e | 68 46 69 6c 65 49 6e 66 |for (pb.|hFileInf|
|00002fb0| 6f 2e 69 6f 46 44 69 72 | 49 6e 64 65 78 20 3d 20 |o.ioFDir|Index = |
|00002fc0| 31 2c 20 65 72 72 20 3d | 20 6e 6f 45 72 72 3b 20 |1, err =| noErr; |
|00002fd0| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 3b 20 70 62 |err == n|oErr; pb|
|00002fe0| 2e 68 46 69 6c 65 49 6e | 66 6f 2e 69 6f 46 44 69 |.hFileIn|fo.ioFDi|
|00002ff0| 72 49 6e 64 65 78 2b 2b | 29 0d 09 7b 0d 09 09 53 |rIndex++|)..{...S|
|00003000| 74 72 33 31 20 66 69 6c | 65 4e 61 6d 65 3b 0d 09 |tr31 fil|eName;..|
|00003010| 09 66 69 6c 65 4e 61 6d | 65 5b 30 5d 20 3d 20 30 |.fileNam|e[0] = 0|
|00003020| 3b 0d 09 09 70 62 2e 68 | 46 69 6c 65 49 6e 66 6f |;...pb.h|FileInfo|
|00003030| 2e 69 6f 4e 61 6d 65 50 | 74 72 20 3d 20 66 69 6c |.ioNameP|tr = fil|
|00003040| 65 4e 61 6d 65 3b 0d 09 | 09 70 62 2e 68 46 69 6c |eName;..|.pb.hFil|
|00003050| 65 49 6e 66 6f 2e 69 6f | 56 52 65 66 4e 75 6d 20 |eInfo.io|VRefNum |
|00003060| 3d 20 76 52 65 66 4e 75 | 6d 3b 0d 09 09 70 62 2e |= vRefNu|m;...pb.|
|00003070| 68 46 69 6c 65 49 6e 66 | 6f 2e 69 6f 44 69 72 49 |hFileInf|o.ioDirI|
|00003080| 44 20 3d 20 66 6f 6c 64 | 65 72 49 44 3b 0d 09 09 |D = fold|erID;...|
|00003090| 65 72 72 20 3d 20 50 42 | 47 65 74 43 61 74 49 6e |err = PB|GetCatIn|
|000030a0| 66 6f 53 79 6e 63 28 26 | 70 62 29 3b 0d 09 09 69 |foSync(&|pb);...i|
|000030b0| 66 20 28 65 72 72 20 3d | 3d 20 6e 6f 45 72 72 20 |f (err =|= noErr |
|000030c0| 26 26 20 28 70 62 2e 68 | 46 69 6c 65 49 6e 66 6f |&& (pb.h|FileInfo|
|000030d0| 2e 69 6f 46 6c 41 74 74 | 72 69 62 20 26 20 30 78 |.ioFlAtt|rib & 0x|
|000030e0| 31 30 29 20 3d 3d 20 30 | 20 26 26 20 28 70 62 2e |10) == 0| && (pb.|
|000030f0| 68 46 69 6c 65 49 6e 66 | 6f 2e 69 6f 46 6c 46 6e |hFileInf|o.ioFlFn|
|00003100| 64 72 49 6e 66 6f 2e 66 | 64 46 6c 61 67 73 20 26 |drInfo.f|dFlags &|
|00003110| 20 6b 49 73 41 6c 69 61 | 73 29 29 0d 09 09 7b 0d | kIsAlia|s))...{.|
|00003120| 09 09 09 2f 2a 20 64 6f | 65 73 20 74 68 65 20 61 |.../* do|es the a|
|00003130| 6c 69 61 73 20 66 69 6c | 65 20 6e 61 6d 65 20 6d |lias fil|e name m|
|00003140| 61 74 63 68 20 74 68 65 | 20 70 72 6f 6a 65 63 74 |atch the| project|
|00003150| 20 6e 61 6d 65 3f 20 2a | 2f 0d 09 09 09 69 66 20 | name? *|/....if |
|00003160| 28 45 71 75 61 6c 53 74 | 72 69 6e 67 28 72 65 61 |(EqualSt|ring(rea|
|00003170| 6c 50 72 6f 6a 65 63 74 | 4e 61 6d 65 2c 20 66 69 |lProject|Name, fi|
|00003180| 6c 65 4e 61 6d 65 2c 20 | 66 61 6c 73 65 2c 20 66 |leName, |false, f|
|00003190| 61 6c 73 65 29 29 0d 09 | 09 09 7b 0d 09 09 09 09 |alse))..|..{.....|
|000031a0| 2f 2a 20 66 6f 75 6e 64 | 20 69 74 21 20 6e 6f 77 |/* found| it! now|
|000031b0| 20 65 78 74 72 61 63 74 | 20 74 68 65 20 61 6c 69 | extract| the ali|
|000031c0| 61 73 20 68 61 6e 64 6c | 65 20 2a 2f 0d 09 09 09 |as handl|e */....|
|000031d0| 09 46 53 53 70 65 63 20 | 66 69 6c 65 3b 0d 09 09 |.FSSpec |file;...|
|000031e0| 09 09 66 69 6c 65 2e 76 | 52 65 66 4e 75 6d 20 3d |..file.v|RefNum =|
|000031f0| 20 76 52 65 66 4e 75 6d | 3b 0d 09 09 09 09 66 69 | vRefNum|;.....fi|
|00003200| 6c 65 2e 70 61 72 49 44 | 20 3d 20 66 6f 6c 64 65 |le.parID| = folde|
|00003210| 72 49 44 3b 0d 09 09 09 | 09 42 6c 6f 63 6b 4d 6f |rID;....|.BlockMo|
|00003220| 76 65 28 66 69 6c 65 4e | 61 6d 65 2c 20 66 69 6c |ve(fileN|ame, fil|
|00003230| 65 2e 6e 61 6d 65 2c 20 | 66 69 6c 65 4e 61 6d 65 |e.name, |fileName|
|00003240| 5b 30 5d 20 2b 20 31 29 | 3b 0d 09 09 09 09 65 72 |[0] + 1)|;.....er|
|00003250| 72 20 3d 20 47 65 74 41 | 6c 69 61 73 46 72 6f 6d |r = GetA|liasFrom|
|00003260| 46 69 6c 65 28 26 66 69 | 6c 65 2c 20 61 6c 69 61 |File(&fi|le, alia|
|00003270| 73 4f 75 74 29 3b 0d 09 | 09 09 09 72 65 74 75 72 |sOut);..|...retur|
|00003280| 6e 20 65 72 72 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d |n err;..|..}...}.|
|00003290| 09 7d 0d 09 0d 09 72 65 | 74 75 72 6e 20 66 6e 66 |.}....re|turn fnf|
|000032a0| 45 72 72 3b 20 2f 2a 20 | 66 69 6c 65 20 6e 6f 74 |Err; /* |file not|
|000032b0| 20 66 6f 75 6e 64 20 65 | 72 72 6f 72 20 2a 2f 0d | found e|rror */.|
|000032c0| 7d 0d 0d 0d 2f 2a 20 66 | 69 6e 64 20 74 68 65 20 |}.../* f|ind the |
|000032d0| 61 6c 69 61 73 20 74 6f | 20 61 20 50 72 6f 6a 65 |alias to| a Proje|
|000032e0| 63 74 6f 72 44 42 20 62 | 61 73 65 64 20 6f 6e 20 |ctorDB b|ased on |
|000032f0| 61 20 63 68 65 63 6b 6f | 75 74 20 66 6f 6c 64 65 |a checko|ut folde|
|00003300| 72 20 2a 2f 0d 0d 4f 53 | 45 72 72 20 46 69 6e 64 |r */..OS|Err Find|
|00003310| 50 72 6f 6a 65 63 74 41 | 6c 69 61 73 46 72 6f 6d |ProjectA|liasFrom|
|00003320| 46 6f 6c 64 65 72 28 73 | 68 6f 72 74 20 76 52 65 |Folder(s|hort vRe|
|00003330| 66 4e 75 6d 2c 20 6c 6f | 6e 67 20 66 6f 6c 64 65 |fNum, lo|ng folde|
|00003340| 72 49 44 2c 20 41 6c 69 | 61 73 48 61 6e 64 6c 65 |rID, Ali|asHandle|
|00003350| 20 2a 61 6c 69 61 73 4f | 75 74 2c 20 53 74 72 69 | *aliasO|ut, Stri|
|00003360| 6e 67 50 74 72 20 70 72 | 6f 6a 65 63 74 4e 61 6d |ngPtr pr|ojectNam|
|00003370| 65 29 0d 7b 0d 09 43 49 | 6e 66 6f 50 42 52 65 63 |e).{..CI|nfoPBRec|
|00003380| 20 70 62 3b 0d 09 53 74 | 72 33 31 20 66 69 6c 65 | pb;..St|r31 file|
|00003390| 4e 61 6d 65 3b 0d 09 53 | 74 72 33 31 20 72 65 61 |Name;..S|tr31 rea|
|000033a0| 6c 50 72 6f 6a 65 63 74 | 4e 61 6d 65 3b 0d 09 4f |lProject|Name;..O|
|000033b0| 53 45 72 72 20 65 72 72 | 20 3d 20 6e 6f 45 72 72 |SErr err| = noErr|
|000033c0| 3b 0d 09 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |;..unsig|ned char|
|000033d0| 20 73 65 70 5b 32 5d 3b | 0d 0d 09 69 66 20 28 66 | sep[2];|...if (f|
|000033e0| 6f 6c 64 65 72 49 44 20 | 3d 3d 20 66 73 52 74 44 |olderID |== fsRtD|
|000033f0| 69 72 49 44 20 7c 7c 20 | 66 6f 6c 64 65 72 49 44 |irID || |folderID|
|00003400| 20 3d 3d 20 66 73 52 74 | 50 61 72 49 44 29 0d 09 | == fsRt|ParID)..|
|00003410| 09 72 65 74 75 72 6e 20 | 66 6e 66 45 72 72 3b 20 |.return |fnfErr; |
|00003420| 2f 2a 20 65 6e 64 20 6f | 66 20 72 65 63 75 72 73 |/* end o|f recurs|
|00003430| 69 6f 6e 20 2a 2f 0d 0d | 09 2f 2a 20 6c 6f 6f 6b |ion */..|./* look|
|00003440| 20 66 6f 72 20 70 72 6f | 6a 65 63 74 6f 72 20 66 | for pro|jector f|
|00003450| 69 6c 65 73 20 69 6e 20 | 74 68 69 73 20 66 6f 6c |iles in |this fol|
|00003460| 64 65 72 3b 20 75 73 65 | 20 6f 6e 65 20 6f 66 20 |der; use| one of |
|00003470| 74 68 65 6d 2e 2e 2e 20 | 2a 2f 09 0d 09 66 6f 72 |them... |*/...for|
|00003480| 20 28 70 62 2e 68 46 69 | 6c 65 49 6e 66 6f 2e 69 | (pb.hFi|leInfo.i|
|00003490| 6f 46 44 69 72 49 6e 64 | 65 78 20 3d 20 31 3b 20 |oFDirInd|ex = 1; |
|000034a0| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 3b 20 70 62 |err == n|oErr; pb|
|000034b0| 2e 68 46 69 6c 65 49 6e | 66 6f 2e 69 6f 46 44 69 |.hFileIn|fo.ioFDi|
|000034c0| 72 49 6e 64 65 78 2b 2b | 29 0d 09 7b 0d 09 09 66 |rIndex++|)..{...f|
|000034d0| 69 6c 65 4e 61 6d 65 5b | 30 5d 20 3d 20 30 3b 0d |ileName[|0] = 0;.|
|000034e0| 09 09 70 62 2e 68 46 69 | 6c 65 49 6e 66 6f 2e 69 |..pb.hFi|leInfo.i|
|000034f0| 6f 4e 61 6d 65 50 74 72 | 20 3d 20 66 69 6c 65 4e |oNamePtr| = fileN|
|00003500| 61 6d 65 3b 0d 09 09 70 | 62 2e 68 46 69 6c 65 49 |ame;...p|b.hFileI|
|00003510| 6e 66 6f 2e 69 6f 56 52 | 65 66 4e 75 6d 20 3d 20 |nfo.ioVR|efNum = |
|00003520| 76 52 65 66 4e 75 6d 3b | 0d 09 09 70 62 2e 68 46 |vRefNum;|...pb.hF|
|00003530| 69 6c 65 49 6e 66 6f 2e | 69 6f 44 69 72 49 44 20 |ileInfo.|ioDirID |
|00003540| 3d 20 66 6f 6c 64 65 72 | 49 44 3b 0d 09 09 65 72 |= folder|ID;...er|
|00003550| 72 20 3d 20 50 42 47 65 | 74 43 61 74 49 6e 66 6f |r = PBGe|tCatInfo|
|00003560| 53 79 6e 63 28 26 70 62 | 29 3b 0d 09 09 69 66 20 |Sync(&pb|);...if |
|00003570| 28 65 72 72 20 3d 3d 20 | 6e 6f 45 72 72 20 26 26 |(err == |noErr &&|
|00003580| 20 28 70 62 2e 68 46 69 | 6c 65 49 6e 66 6f 2e 69 | (pb.hFi|leInfo.i|
|00003590| 6f 46 6c 41 74 74 72 69 | 62 20 26 20 30 78 31 30 |oFlAttri|b & 0x10|
|000035a0| 29 20 3d 3d 20 30 20 26 | 26 20 70 62 2e 68 46 69 |) == 0 &|& pb.hFi|
|000035b0| 6c 65 49 6e 66 6f 2e 69 | 6f 46 6c 52 4c 67 4c 65 |leInfo.i|oFlRLgLe|
|000035c0| 6e 20 3e 20 30 29 0d 09 | 09 7b 0d 09 09 09 2f 2a |n > 0)..|.{..../*|
|000035d0| 20 69 74 27 73 20 61 20 | 66 69 6c 65 20 61 6e 64 | it's a |file and|
|000035e0| 20 69 74 20 68 61 73 20 | 61 20 72 65 73 6f 75 72 | it has |a resour|
|000035f0| 63 65 20 66 6f 72 6b 20 | 2d 2d 20 67 65 74 20 74 |ce fork |-- get t|
|00003600| 68 65 20 43 4b 49 44 20 | 2a 2f 0d 09 09 09 43 4b |he CKID |*/....CK|
|00003610| 49 44 48 61 6e 64 6c 65 | 20 74 68 65 43 4b 49 44 |IDHandle| theCKID|
|00003620| 3b 0d 09 09 09 46 53 53 | 70 65 63 20 66 69 6c 65 |;....FSS|pec file|
|00003630| 3b 0d 09 09 09 0d 09 09 | 09 66 69 6c 65 2e 76 52 |;.......|.file.vR|
|00003640| 65 66 4e 75 6d 20 3d 20 | 76 52 65 66 4e 75 6d 3b |efNum = |vRefNum;|
|00003650| 0d 09 09 09 66 69 6c 65 | 2e 70 61 72 49 44 20 3d |....file|.parID =|
|00003660| 20 66 6f 6c 64 65 72 49 | 44 3b 0d 09 09 09 42 6c | folderI|D;....Bl|
|00003670| 6f 63 6b 4d 6f 76 65 28 | 66 69 6c 65 4e 61 6d 65 |ockMove(|fileName|
|00003680| 2c 20 66 69 6c 65 2e 6e | 61 6d 65 2c 20 66 69 6c |, file.n|ame, fil|
|00003690| 65 4e 61 6d 65 5b 30 5d | 20 2b 20 31 29 3b 0d 09 |eName[0]| + 1);..|
|000036a0| 09 09 65 72 72 20 3d 20 | 45 78 74 72 61 63 74 43 |..err = |ExtractC|
|000036b0| 4b 49 44 28 26 66 69 6c | 65 2c 20 26 74 68 65 43 |KID(&fil|e, &theC|
|000036c0| 4b 49 44 29 3b 0d 09 09 | 09 69 66 20 28 65 72 72 |KID);...|.if (err|
|000036d0| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 09 09 7b 0d | == noEr|r)....{.|
|000036e0| 09 09 09 09 65 72 72 20 | 3d 20 46 69 6e 64 50 72 |....err |= FindPr|
|000036f0| 6f 6a 65 63 74 41 6c 69 | 61 73 46 72 6f 6d 43 4b |ojectAli|asFromCK|
|00003700| 49 44 28 74 68 65 43 4b | 49 44 2c 20 61 6c 69 61 |ID(theCK|ID, alia|
|00003710| 73 4f 75 74 2c 20 70 72 | 6f 6a 65 63 74 4e 61 6d |sOut, pr|ojectNam|
|00003720| 65 29 3b 0d 09 09 09 09 | 44 69 73 70 6f 73 65 48 |e);.....|DisposeH|
|00003730| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 74 68 |andle((H|andle)th|
|00003740| 65 43 4b 49 44 29 3b 0d | 09 09 09 09 69 66 20 28 |eCKID);.|....if (|
|00003750| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 29 0d 09 09 |err == n|oErr)...|
|00003760| 09 09 09 72 65 74 75 72 | 6e 20 6e 6f 45 72 72 3b |...retur|n noErr;|
|00003770| 0d 09 09 09 7d 0d 09 09 | 7d 0d 09 7d 0d 09 0d 09 |....}...|}..}....|
|00003780| 2f 2a 20 74 68 61 74 20 | 64 69 64 6e 27 74 20 77 |/* that |didn't w|
|00003790| 6f 72 6b 20 2d 2d 20 6e | 6f 77 20 74 72 79 20 77 |ork -- n|ow try w|
|000037a0| 61 6c 6b 69 6e 67 20 75 | 70 20 74 68 65 20 66 6f |alking u|p the fo|
|000037b0| 6c 64 65 72 73 20 2a 2f | 0d 09 0d 09 2f 2a 20 73 |lders */|..../* s|
|000037c0| 65 74 20 75 70 20 74 68 | 65 20 69 6e 69 74 69 61 |et up th|e initia|
|000037d0| 6c 20 70 72 6f 6a 65 63 | 74 20 6e 61 6d 65 20 2a |l projec|t name *|
|000037e0| 2f 0d 09 73 65 70 5b 30 | 5d 20 3d 20 31 3b 0d 09 |/..sep[0|] = 1;..|
|000037f0| 73 65 70 5b 31 5d 20 3d | 20 6b 50 72 6f 6a 65 63 |sep[1] =| kProjec|
|00003800| 74 6f 72 50 61 74 68 53 | 65 70 61 72 61 74 6f 72 |torPathS|eparator|
|00003810| 3b 0d 09 0d 09 2f 2a 20 | 66 69 6e 64 20 74 68 65 |;..../* |find the|
|00003820| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 66 6f 6c | name of| the fol|
|00003830| 64 65 72 20 73 70 65 63 | 69 66 69 65 64 20 69 6e |der spec|ified in|
|00003840| 20 74 68 65 20 61 72 67 | 75 6d 65 6e 74 73 20 2a | the arg|uments *|
|00003850| 2f 0d 09 66 69 6c 65 4e | 61 6d 65 5b 30 5d 20 3d |/..fileN|ame[0] =|
|00003860| 20 30 3b 0d 09 70 62 2e | 68 46 69 6c 65 49 6e 66 | 0;..pb.|hFileInf|
|00003870| 6f 2e 69 6f 4e 61 6d 65 | 50 74 72 20 3d 20 66 69 |o.ioName|Ptr = fi|
|00003880| 6c 65 4e 61 6d 65 3b 0d | 09 70 62 2e 68 46 69 6c |leName;.|.pb.hFil|
|00003890| 65 49 6e 66 6f 2e 69 6f | 56 52 65 66 4e 75 6d 20 |eInfo.io|VRefNum |
|000038a0| 3d 20 76 52 65 66 4e 75 | 6d 3b 0d 09 70 62 2e 68 |= vRefNu|m;..pb.h|
|000038b0| 46 69 6c 65 49 6e 66 6f | 2e 69 6f 44 69 72 49 44 |FileInfo|.ioDirID|
|000038c0| 20 3d 20 66 6f 6c 64 65 | 72 49 44 3b 0d 09 70 62 | = folde|rID;..pb|
|000038d0| 2e 68 46 69 6c 65 49 6e | 66 6f 2e 69 6f 46 44 69 |.hFileIn|fo.ioFDi|
|000038e0| 72 49 6e 64 65 78 20 3d | 20 2d 31 3b 0d 09 65 72 |rIndex =| -1;..er|
|000038f0| 72 20 3d 20 50 42 47 65 | 74 43 61 74 49 6e 66 6f |r = PBGe|tCatInfo|
|00003900| 53 79 6e 63 28 26 70 62 | 29 3b 0d 09 69 66 20 28 |Sync(&pb|);..if (|
|00003910| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 0d 09 09 |err != n|oErr)...|
|00003920| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 09 0d 09 2f |return e|rr;..../|
|00003930| 2a 20 73 65 65 20 69 66 | 20 74 68 65 20 61 72 67 |* see if| the arg|
|00003940| 75 6d 65 6e 74 20 66 6f | 6c 64 65 72 20 69 73 20 |ument fo|lder is |
|00003950| 74 68 65 20 70 72 6f 6a | 65 63 74 20 2a 2f 0d 09 |the proj|ect */..|
|00003960| 65 72 72 20 3d 20 46 69 | 6e 64 50 72 6f 6a 65 63 |err = Fi|ndProjec|
|00003970| 74 41 6c 69 61 73 46 72 | 6f 6d 50 72 6f 6a 65 63 |tAliasFr|omProjec|
|00003980| 74 4e 61 6d 65 28 66 69 | 6c 65 4e 61 6d 65 2c 20 |tName(fi|leName, |
|00003990| 72 65 61 6c 50 72 6f 6a | 65 63 74 4e 61 6d 65 2c |realProj|ectName,|
|000039a0| 20 61 6c 69 61 73 4f 75 | 74 2c 20 74 72 75 65 29 | aliasOu|t, true)|
|000039b0| 3b 0d 09 69 66 20 28 65 | 72 72 20 3d 3d 20 6e 6f |;..if (e|rr == no|
|000039c0| 45 72 72 29 0d 09 7b 0d | 09 09 70 72 6f 6a 65 63 |Err)..{.|..projec|
|000039d0| 74 4e 61 6d 65 5b 30 5d | 20 3d 20 30 3b 0d 09 09 |tName[0]| = 0;...|
|000039e0| 41 70 70 65 6e 64 53 74 | 72 69 6e 67 28 70 72 6f |AppendSt|ring(pro|
|000039f0| 6a 65 63 74 4e 61 6d 65 | 2c 20 72 65 61 6c 50 72 |jectName|, realPr|
|00003a00| 6f 6a 65 63 74 4e 61 6d | 65 29 3b 0d 09 09 41 70 |ojectNam|e);...Ap|
|00003a10| 70 65 6e 64 53 74 72 69 | 6e 67 28 70 72 6f 6a 65 |pendStri|ng(proje|
|00003a20| 63 74 4e 61 6d 65 2c 20 | 73 65 70 29 3b 0d 09 09 |ctName, |sep);...|
|00003a30| 72 65 74 75 72 6e 20 6e | 6f 45 72 72 3b 0d 09 7d |return n|oErr;..}|
|00003a40| 0d 09 0d 09 2f 2a 20 72 | 65 63 75 72 73 65 20 75 |..../* r|ecurse u|
|00003a50| 70 77 61 72 64 73 20 6c | 6f 6f 6b 69 6e 67 20 66 |pwards l|ooking f|
|00003a60| 6f 72 20 61 20 70 72 6f | 6a 65 63 74 20 2a 2f 0d |or a pro|ject */.|
|00003a70| 09 69 66 20 28 70 62 2e | 64 69 72 49 6e 66 6f 2e |.if (pb.|dirInfo.|
|00003a80| 69 6f 44 72 50 61 72 49 | 44 20 21 3d 20 66 73 52 |ioDrParI|D != fsR|
|00003a90| 74 44 69 72 49 44 20 26 | 26 20 70 62 2e 64 69 72 |tDirID &|& pb.dir|
|00003aa0| 49 6e 66 6f 2e 69 6f 44 | 72 50 61 72 49 44 20 21 |Info.ioD|rParID !|
|00003ab0| 3d 20 66 73 52 74 50 61 | 72 49 44 29 0d 09 7b 0d |= fsRtPa|rID)..{.|
|00003ac0| 09 09 65 72 72 20 3d 20 | 46 69 6e 64 50 72 6f 6a |..err = |FindProj|
|00003ad0| 65 63 74 41 6c 69 61 73 | 46 72 6f 6d 46 6f 6c 64 |ectAlias|FromFold|
|00003ae0| 65 72 28 76 52 65 66 4e | 75 6d 2c 20 70 62 2e 64 |er(vRefN|um, pb.d|
|00003af0| 69 72 49 6e 66 6f 2e 69 | 6f 44 72 50 61 72 49 44 |irInfo.i|oDrParID|
|00003b00| 2c 20 61 6c 69 61 73 4f | 75 74 2c 20 70 72 6f 6a |, aliasO|ut, proj|
|00003b10| 65 63 74 4e 61 6d 65 29 | 3b 0d 09 09 69 66 20 28 |ectName)|;...if (|
|00003b20| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 29 0d 09 09 |err == n|oErr)...|
|00003b30| 7b 0d 09 09 09 41 70 70 | 65 6e 64 53 74 72 69 6e |{....App|endStrin|
|00003b40| 67 28 70 72 6f 6a 65 63 | 74 4e 61 6d 65 2c 20 66 |g(projec|tName, f|
|00003b50| 69 6c 65 4e 61 6d 65 29 | 3b 0d 09 09 09 41 70 70 |ileName)|;....App|
|00003b60| 65 6e 64 53 74 72 69 6e | 67 28 70 72 6f 6a 65 63 |endStrin|g(projec|
|00003b70| 74 4e 61 6d 65 2c 20 73 | 65 70 29 3b 0d 09 09 09 |tName, s|ep);....|
|00003b80| 72 65 74 75 72 6e 20 6e | 6f 45 72 72 3b 0d 09 09 |return n|oErr;...|
|00003b90| 7d 0d 09 7d 0d 09 0d 09 | 72 65 74 75 72 6e 20 66 |}..}....|return f|
|00003ba0| 6e 66 45 72 72 3b 20 2f | 2a 20 66 69 6c 65 20 6e |nfErr; /|* file n|
|00003bb0| 6f 74 20 66 6f 75 6e 64 | 20 65 72 72 6f 72 20 2a |ot found| error *|
|00003bc0| 2f 0d 7d 0d 0d 0d 2f 2a | 20 47 69 76 65 6e 20 61 |/.}.../*| Given a|
|00003bd0| 6e 20 61 6c 69 61 73 20 | 74 6f 20 61 20 50 72 6f |n alias |to a Pro|
|00003be0| 6a 65 63 74 6f 72 44 42 | 2c 20 6d 6f 75 6e 74 20 |jectorDB|, mount |
|00003bf0| 69 74 2e 20 2a 2f 0d 0d | 4f 53 45 72 72 20 4d 6f |it. */..|OSErr Mo|
|00003c00| 75 6e 74 50 72 6f 6a 65 | 63 74 41 6c 69 61 73 28 |untProje|ctAlias(|
|00003c10| 41 6c 69 61 73 48 61 6e | 64 6c 65 20 61 6c 69 61 |AliasHan|dle alia|
|00003c20| 73 2c 20 43 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |s, CStri|ngHandle|
|00003c30| 20 2a 6f 75 74 70 75 74 | 2c 20 43 53 74 72 69 6e | *output|, CStrin|
|00003c40| 67 48 61 6e 64 6c 65 20 | 2a 64 69 61 67 6e 6f 73 |gHandle |*diagnos|
|00003c50| 74 69 63 29 0d 7b 0d 09 | 4f 53 45 72 72 20 65 72 |tic).{..|OSErr er|
|00003c60| 72 3b 0d 09 73 68 6f 72 | 74 20 61 6c 69 61 73 43 |r;..shor|t aliasC|
|00003c70| 6f 75 6e 74 20 3d 20 31 | 3b 0d 09 46 53 53 70 65 |ount = 1|;..FSSpe|
|00003c80| 63 20 70 72 6f 6a 65 63 | 74 46 69 6c 65 3b 0d 09 |c projec|tFile;..|
|00003c90| 42 6f 6f 6c 65 61 6e 20 | 6e 65 65 64 73 55 70 64 |Boolean |needsUpd|
|00003ca0| 61 74 65 3b 0d 09 41 45 | 44 65 73 63 20 63 6f 6d |ate;..AE|Desc com|
|00003cb0| 6d 61 6e 64 3b 0d 09 0d | 09 2a 6f 75 74 70 75 74 |mand;...|.*output|
|00003cc0| 20 3d 20 2a 64 69 61 67 | 6e 6f 73 74 69 63 20 3d | = *diag|nostic =|
|00003cd0| 20 4e 55 4c 4c 3b 0d 09 | 0d 09 2f 2a 20 72 65 73 | NULL;..|../* res|
|00003ce0| 6f 6c 76 65 20 74 68 65 | 20 61 6c 69 61 73 20 74 |olve the| alias t|
|00003cf0| 6f 20 61 75 74 6f 2d 6d | 6f 75 6e 74 20 74 68 65 |o auto-m|ount the|
|00003d00| 20 73 65 72 76 65 72 20 | 2a 2f 0d 09 65 72 72 20 | server |*/..err |
|00003d10| 3d 20 4d 61 74 63 68 41 | 6c 69 61 73 20 28 4e 55 |= MatchA|lias (NU|
|00003d20| 4c 4c 2c 20 6b 41 52 4d | 53 65 61 72 63 68 20 2b |LL, kARM|Search +|
|00003d30| 20 6b 41 52 4d 4d 6f 75 | 6e 74 56 6f 6c 2c 20 61 | kARMMou|ntVol, a|
|00003d40| 6c 69 61 73 2c 20 26 61 | 6c 69 61 73 43 6f 75 6e |lias, &a|liasCoun|
|00003d50| 74 2c 20 26 70 72 6f 6a | 65 63 74 46 69 6c 65 2c |t, &proj|ectFile,|
|00003d60| 20 26 6e 65 65 64 73 55 | 70 64 61 74 65 2c 20 4e | &needsU|pdate, N|
|00003d70| 55 4c 4c 2c 20 4e 55 4c | 4c 29 3b 0d 09 69 66 20 |ULL, NUL|L);..if |
|00003d80| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 0d 09 |(err != |noErr)..|
|00003d90| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 09 0d 09 |.return |err;....|
|00003da0| 2f 2a 20 69 73 20 74 68 | 69 73 20 70 72 6f 6a 65 |/* is th|is proje|
|00003db0| 63 74 20 61 6c 72 65 61 | 64 79 20 6d 6f 75 6e 74 |ct alrea|dy mount|
|00003dc0| 65 64 3f 0d 09 20 2a 20 | 50 72 6f 6a 65 63 74 49 |ed?.. * |ProjectI|
|00003dd0| 6e 66 6f 20 2d 6f 6e 6c | 79 20 2d 70 72 6f 6a 65 |nfo -onl|y -proje|
|00003de0| 63 74 20 3c 70 72 6f 6a | 65 63 74 4e 61 6d 65 3e |ct <proj|ectName>|
|00003df0| 0d 09 20 2a 2f 0d 09 65 | 72 72 20 3d 20 43 72 65 |.. */..e|rr = Cre|
|00003e00| 61 74 65 43 6f 6d 6d 61 | 6e 64 28 26 63 6f 6d 6d |ateComma|nd(&comm|
|00003e10| 61 6e 64 2c 20 22 50 72 | 6f 6a 65 63 74 49 6e 66 |and, "Pr|ojectInf|
|00003e20| 6f 22 29 3b 0d 09 69 66 | 20 28 65 72 72 20 3d 3d |o");..if| (err ==|
|00003e30| 20 6e 6f 45 72 72 29 0d | 09 7b 0d 09 09 42 6f 6f | noErr).|.{...Boo|
|00003e40| 6c 65 61 6e 20 61 6c 72 | 65 61 64 79 4d 6f 75 6e |lean alr|eadyMoun|
|00003e50| 74 65 64 20 3d 20 66 61 | 6c 73 65 3b 0d 09 09 65 |ted = fa|lse;...e|
|00003e60| 72 72 20 3d 20 41 64 64 | 43 53 74 72 69 6e 67 41 |rr = Add|CStringA|
|00003e70| 72 67 28 26 63 6f 6d 6d | 61 6e 64 2c 20 22 2d 6f |rg(&comm|and, "-o|
|00003e80| 6e 6c 79 22 29 3b 0d 09 | 09 69 66 20 28 65 72 72 |nly");..|.if (err|
|00003e90| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 09 7b 0d 09 | == noEr|r)...{..|
|00003ea0| 09 09 65 72 72 20 3d 20 | 41 64 64 50 72 6f 6a 65 |..err = |AddProje|
|00003eb0| 63 74 41 72 67 28 26 63 | 6f 6d 6d 61 6e 64 2c 20 |ctArg(&c|ommand, |
|00003ec0| 70 72 6f 6a 65 63 74 46 | 69 6c 65 2e 6e 61 6d 65 |projectF|ile.name|
|00003ed0| 29 3b 0d 09 09 09 69 66 | 20 28 65 72 72 20 3d 3d |);....if| (err ==|
|00003ee0| 20 6e 6f 45 72 72 29 0d | 09 09 09 7b 0d 09 09 09 | noErr).|...{....|
|00003ef0| 09 65 72 72 20 3d 20 53 | 6f 75 72 63 65 53 65 72 |.err = S|ourceSer|
|00003f00| 76 65 72 43 6f 6d 6d 61 | 6e 64 28 26 63 6f 6d 6d |verComma|nd(&comm|
|00003f10| 61 6e 64 2c 20 6f 75 74 | 70 75 74 2c 20 64 69 61 |and, out|put, dia|
|00003f20| 67 6e 6f 73 74 69 63 2c | 20 50 72 6f 6a 65 63 74 |gnostic,| Project|
|00003f30| 44 72 61 67 49 64 6c 65 | 50 72 6f 63 2c 20 4e 55 |DragIdle|Proc, NU|
|00003f40| 4c 4c 29 3b 0d 09 09 09 | 09 61 6c 72 65 61 64 79 |LL);....|.already|
|00003f50| 4d 6f 75 6e 74 65 64 20 | 3d 20 28 65 72 72 20 3d |Mounted |= (err =|
|00003f60| 3d 20 6e 6f 45 72 72 29 | 3b 0d 09 09 09 09 69 66 |= noErr)|;.....if|
|00003f70| 20 28 2a 6f 75 74 70 75 | 74 20 21 3d 20 4e 55 4c | (*outpu|t != NUL|
|00003f80| 4c 29 0d 09 09 09 09 09 | 44 69 73 70 6f 73 65 48 |L)......|DisposeH|
|00003f90| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 2a 6f |andle((H|andle)*o|
|00003fa0| 75 74 70 75 74 29 3b 0d | 09 09 09 09 69 66 20 28 |utput);.|....if (|
|00003fb0| 2a 64 69 61 67 6e 6f 73 | 74 69 63 20 21 3d 20 4e |*diagnos|tic != N|
|00003fc0| 55 4c 4c 29 0d 09 09 09 | 09 09 44 69 73 70 6f 73 |ULL)....|..Dispos|
|00003fd0| 65 48 61 6e 64 6c 65 28 | 28 48 61 6e 64 6c 65 29 |eHandle(|(Handle)|
|00003fe0| 2a 64 69 61 67 6e 6f 73 | 74 69 63 29 3b 0d 09 09 |*diagnos|tic);...|
|00003ff0| 09 09 2a 6f 75 74 70 75 | 74 20 3d 20 2a 64 69 61 |..*outpu|t = *dia|
|00004000| 67 6e 6f 73 74 69 63 20 | 3d 20 4e 55 4c 4c 3b 0d |gnostic |= NULL;.|
|00004010| 09 09 09 7d 0d 09 09 7d | 0d 09 09 41 45 44 69 73 |...}...}|...AEDis|
|00004020| 70 6f 73 65 44 65 73 63 | 28 26 63 6f 6d 6d 61 6e |poseDesc|(&comman|
|00004030| 64 29 3b 0d 09 09 69 66 | 20 28 61 6c 72 65 61 64 |d);...if| (alread|
|00004040| 79 4d 6f 75 6e 74 65 64 | 29 0d 09 09 09 72 65 74 |yMounted|)....ret|
|00004050| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 09 09 65 6c 73 |urn noEr|r;...els|
|00004060| 65 20 69 66 20 28 65 72 | 72 20 3c 20 6e 6f 45 72 |e if (er|r < noEr|
|00004070| 72 29 20 2f 2a 20 6e 6f | 74 20 6d 6f 75 6e 74 65 |r) /* no|t mounte|
|00004080| 64 20 72 65 74 75 72 6e | 73 20 61 20 70 6f 73 69 |d return|s a posi|
|00004090| 74 69 76 65 20 65 72 72 | 6f 72 20 73 74 61 74 75 |tive err|or statu|
|000040a0| 73 20 28 32 29 20 2a 2f | 0d 09 09 09 72 65 74 75 |s (2) */|....retu|
|000040b0| 72 6e 20 65 72 72 3b 0d | 09 7d 0d 09 0d 09 2f 2a |rn err;.|.}..../*|
|000040c0| 20 73 65 6e 64 20 74 68 | 65 20 4d 6f 75 6e 74 50 | send th|e MountP|
|000040d0| 72 6f 6a 65 63 74 20 63 | 6f 6d 6d 61 6e 64 20 2a |roject c|ommand *|
|000040e0| 2f 0d 09 65 72 72 20 3d | 20 43 72 65 61 74 65 43 |/..err =| CreateC|
|000040f0| 6f 6d 6d 61 6e 64 28 26 | 63 6f 6d 6d 61 6e 64 2c |ommand(&|command,|
|00004100| 20 22 4d 6f 75 6e 74 50 | 72 6f 6a 65 63 74 22 29 | "MountP|roject")|
|00004110| 3b 0d 09 69 66 20 28 65 | 72 72 20 3d 3d 20 6e 6f |;..if (e|rr == no|
|00004120| 45 72 72 29 0d 09 7b 0d | 09 09 65 72 72 20 3d 20 |Err)..{.|..err = |
|00004130| 41 64 64 46 69 6c 65 4e | 61 6d 65 41 72 67 28 26 |AddFileN|ameArg(&|
|00004140| 63 6f 6d 6d 61 6e 64 2c | 20 26 70 72 6f 6a 65 63 |command,| &projec|
|00004150| 74 46 69 6c 65 29 3b 0d | 09 09 69 66 20 28 65 72 |tFile);.|..if (er|
|00004160| 72 20 3d 3d 20 6e 6f 45 | 72 72 29 0d 09 09 09 65 |r == noE|rr)....e|
|00004170| 72 72 20 3d 20 53 6f 75 | 72 63 65 53 65 72 76 65 |rr = Sou|rceServe|
|00004180| 72 43 6f 6d 6d 61 6e 64 | 28 26 63 6f 6d 6d 61 6e |rCommand|(&comman|
|00004190| 64 2c 20 6f 75 74 70 75 | 74 2c 20 64 69 61 67 6e |d, outpu|t, diagn|
|000041a0| 6f 73 74 69 63 2c 20 50 | 72 6f 6a 65 63 74 44 72 |ostic, P|rojectDr|
|000041b0| 61 67 49 64 6c 65 50 72 | 6f 63 2c 20 4e 55 4c 4c |agIdlePr|oc, NULL|
|000041c0| 29 3b 0d 09 09 41 45 44 | 69 73 70 6f 73 65 44 65 |);...AED|isposeDe|
|000041d0| 73 63 28 26 63 6f 6d 6d | 61 6e 64 29 3b 0d 09 7d |sc(&comm|and);..}|
|000041e0| 0d 09 72 65 74 75 72 6e | 20 65 72 72 3b 0d 7d 0d |..return| err;.}.|
|000041f0| 0d 0d 42 6f 6f 6c 65 61 | 6e 20 53 65 6c 65 63 74 |..Boolea|n Select|
|00004200| 50 72 6f 6a 65 63 74 6f | 72 44 42 28 46 53 53 70 |Projecto|rDB(FSSp|
|00004210| 65 63 20 2a 66 69 6c 65 | 2c 20 73 68 6f 72 74 20 |ec *file|, short |
|00004220| 73 74 72 4c 69 73 74 49 | 44 2c 20 73 68 6f 72 74 |strListI|D, short|
|00004230| 20 73 74 72 49 6e 64 65 | 78 2c 0d 09 09 09 09 09 | strInde|x,......|
|00004240| 09 09 46 69 6c 65 46 69 | 6c 74 65 72 59 44 50 72 |..FileFi|lterYDPr|
|00004250| 6f 63 50 74 72 20 66 69 | 6c 74 65 72 2c 20 76 6f |ocPtr fi|lter, vo|
|00004260| 69 64 20 2a 64 61 74 61 | 50 74 72 29 0d 7b 0d 09 |id *data|Ptr).{..|
|00004270| 4f 53 54 79 70 65 20 74 | 68 65 54 79 70 65 20 3d |OSType t|heType =|
|00004280| 20 27 4d 50 53 50 27 3b | 0d 09 53 74 61 6e 64 61 | 'MPSP';|..Standa|
|00004290| 72 64 46 69 6c 65 52 65 | 70 6c 79 20 72 65 70 6c |rdFileRe|ply repl|
|000042a0| 79 3b 0d 09 53 74 72 32 | 35 35 20 70 72 6f 6d 70 |y;..Str2|55 promp|
|000042b0| 74 3b 0d 09 50 6f 69 6e | 74 20 77 68 65 72 65 3b |t;..Poin|t where;|
|000042c0| 0d 09 73 68 6f 72 74 20 | 76 52 65 66 4e 75 6d 3b |..short |vRefNum;|
|000042d0| 0d 09 6c 6f 6e 67 20 66 | 6f 6c 64 65 72 49 44 3b |..long f|olderID;|
|000042e0| 0d 09 4f 53 45 72 72 20 | 65 72 72 3b 0d 09 0d 09 |..OSErr |err;....|
|000042f0| 65 72 72 20 3d 20 46 69 | 6e 64 50 72 65 66 65 72 |err = Fi|ndPrefer|
|00004300| 65 6e 63 65 73 46 6f 6c | 64 65 72 28 26 76 52 65 |encesFol|der(&vRe|
|00004310| 66 4e 75 6d 2c 20 26 66 | 6f 6c 64 65 72 49 44 29 |fNum, &f|olderID)|
|00004320| 3b 0d 09 69 66 20 28 65 | 72 72 20 3d 3d 20 6e 6f |;..if (e|rr == no|
|00004330| 45 72 72 29 0d 09 7b 0d | 09 09 4c 4d 53 65 74 53 |Err)..{.|..LMSetS|
|00004340| 46 53 61 76 65 44 69 73 | 6b 28 2d 76 52 65 66 4e |FSaveDis|k(-vRefN|
|00004350| 75 6d 29 3b 0d 09 09 4c | 4d 53 65 74 43 75 72 44 |um);...L|MSetCurD|
|00004360| 69 72 53 74 6f 72 65 28 | 66 6f 6c 64 65 72 49 44 |irStore(|folderID|
|00004370| 29 3b 0d 09 7d 0d 09 53 | 65 74 50 74 28 26 77 68 |);..}..S|etPt(&wh|
|00004380| 65 72 65 2c 20 2d 31 2c | 20 2d 31 29 3b 0d 09 47 |ere, -1,| -1);..G|
|00004390| 65 74 49 6e 64 53 74 72 | 69 6e 67 28 70 72 6f 6d |etIndStr|ing(prom|
|000043a0| 70 74 2c 20 73 74 72 4c | 69 73 74 49 44 2c 20 73 |pt, strL|istID, s|
|000043b0| 74 72 49 6e 64 65 78 29 | 3b 0d 09 50 61 72 61 6d |trIndex)|;..Param|
|000043c0| 54 65 78 74 28 70 72 6f | 6d 70 74 2c 20 4e 55 4c |Text(pro|mpt, NUL|
|000043d0| 4c 2c 20 4e 55 4c 4c 2c | 20 4e 55 4c 4c 29 3b 0d |L, NULL,| NULL);.|
|000043e0| 09 43 75 73 74 6f 6d 47 | 65 74 46 69 6c 65 20 28 |.CustomG|etFile (|
|000043f0| 66 69 6c 74 65 72 2c 20 | 31 2c 20 26 74 68 65 54 |filter, |1, &theT|
|00004400| 79 70 65 2c 20 26 72 65 | 70 6c 79 2c 20 6b 53 65 |ype, &re|ply, kSe|
|00004410| 6c 65 63 74 57 69 74 68 | 50 72 6f 6d 70 74 44 69 |lectWith|PromptDi|
|00004420| 61 6c 6f 67 2c 20 77 68 | 65 72 65 2c 0d 09 09 09 |alog, wh|ere,....|
|00004430| 09 09 4e 55 4c 4c 2c 20 | 4e 55 4c 4c 2c 20 4e 55 |..NULL, |NULL, NU|
|00004440| 4c 4c 2c 20 4e 55 4c 4c | 2c 20 64 61 74 61 50 74 |LL, NULL|, dataPt|
|00004450| 72 29 3b 0d 09 69 66 20 | 28 72 65 70 6c 79 2e 73 |r);..if |(reply.s|
|00004460| 66 47 6f 6f 64 29 0d 09 | 09 2a 66 69 6c 65 20 3d |fGood)..|.*file =|
|00004470| 20 72 65 70 6c 79 2e 73 | 66 46 69 6c 65 3b 0d 09 | reply.s|fFile;..|
|00004480| 72 65 74 75 72 6e 20 72 | 65 70 6c 79 2e 73 66 47 |return r|eply.sfG|
|00004490| 6f 6f 64 3b 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 |ood;.}..|........|
|000044a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004500| 00 00 01 00 00 00 01 ea | 00 00 00 ea 00 00 00 4a |........|.......J|
|00004510| 00 01 3a a6 00 01 3a e2 | 00 01 3b 04 00 01 3b 20 |..:...:.|..;...; |
|00004520| 00 01 3b d2 00 01 3c 72 | 00 01 3d 06 00 01 3d 12 |..;...<r|..=...=.|
|00004530| 0e 50 72 6f 6a 65 63 74 | 41 6c 69 61 73 2e 63 6c |.Project|Alias.cl|
|00004540| 02 00 00 00 54 45 58 54 | 4d 50 53 20 01 00 ff ff |....TEXT|MPS ....|
|00004550| 00 00 54 45 58 54 4d 50 | 53 20 01 00 ff ff ff ff |..TEXTMP|S ......|
|00004560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004570| 00 00 ab d5 4e fe 00 00 | 44 17 00 00 02 34 40 b4 |....N...|D....4@.|
|00004580| 00 01 40 c4 00 01 40 d2 | 00 01 41 ac 00 01 42 12 |..@...@.|..A...B.|
|00004590| 00 01 42 22 00 01 42 5e | 00 01 42 80 00 01 43 30 |..B"..B^|..B...C0|
|000045a0| 00 01 43 d0 00 01 44 70 | 00 01 44 98 00 01 44 dc |..C...Dp|..D...D.|
|000045b0| 00 01 45 74 00 01 45 9c | 00 01 45 de 00 01 46 44 |..Et..E.|..E...FD|
|000045c0| 00 01 47 2c 00 01 47 3a | 00 01 47 4a 00 01 47 5a |..G,..G:|..GJ..GZ|
|000045d0| 00 01 47 66 00 01 47 72 | 00 01 47 7e 00 01 47 8a |..Gf..Gr|..G~..G.|
|000045e0| 00 01 47 96 00 01 47 a2 | 00 01 48 36 00 01 48 e8 |..G...G.|..H6..H.|
|000045f0| 00 01 49 7e 00 01 49 9a | 00 01 49 aa 00 01 49 b8 |..I~..I.|..I...I.|
|00004600| 00 00 00 78 00 03 00 00 | 00 48 00 48 00 00 00 00 |...x....|.H.H....|
|00004610| 02 da 02 28 ff e1 ff e1 | 02 f9 02 45 03 47 05 28 |...(....|...E.G.(|
|00004620| 03 fc 00 02 00 00 00 48 | 00 48 00 00 00 00 02 da |.......H|.H......|
|00004630| 02 28 00 01 00 00 00 64 | 00 00 00 01 00 03 03 03 |.(.....d|........|
|00004640| 00 00 00 01 27 0f 00 01 | 00 01 00 00 00 00 00 00 |....'...|........|
|00004650| 00 00 00 00 00 00 68 08 | 00 19 01 90 00 00 00 00 |......h.|........|
|00004660| 20 00 00 00 00 00 00 00 | 00 00 00 01 00 00 00 00 | .......|........|
|00004670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 48 |........|.......H|
|00004680| 00 09 4d 6f 6e 61 63 6f | 00 73 68 6f 00 fb 44 e0 |..Monaco|.sho..D.|
|00004690| 52 65 66 4e 75 6d 2c 20 | 6c 6f 6e 67 20 66 6f 6c |RefNum, |long fol|
|000046a0| 64 65 00 06 00 04 00 50 | 00 20 01 dd 02 3d 00 50 |de.....P|. ...=.P|
|000046b0| 00 20 01 dd 02 3d ac 28 | 3c 98 00 00 1b 21 00 00 |. ...=.(|<....!..|
|000046c0| 1b 71 00 00 19 f5 01 00 | 00 00 00 1e 00 50 00 20 |.q......|.....P. |
|000046d0| 01 dd 02 3d 00 50 00 20 | 01 dd 02 3d 00 00 19 f5 |...=.P. |...=....|
|000046e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|000046f0| 01 ea 00 00 00 ea 00 00 | 00 4a 00 e6 06 48 22 86 |........|.J...H".|
|00004700| 00 00 00 1c 00 4a 00 00 | 4d 50 53 52 00 02 00 0a |.....J..|MPSR....|
|00004710| 03 ee ff ff 00 00 00 00 | 00 00 00 00 03 ed ff ff |........|........|
|00004720| 00 00 00 7c 00 00 00 00 | 03 f0 ff ff 00 00 00 c8 |...|....|........|
|00004730| 00 f0 b8 a4 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+